]> Pileus Git - grits/blobdiff - src/grits-opengl.c
Update valgrind suppressions
[grits] / src / grits-opengl.c
index 93a116528cbb37eddf0c471f25150a7879cc7f30..d8eda2752c7299cd33ba052c30869bedd6f2c118 100644 (file)
@@ -67,7 +67,7 @@ static void _set_visuals(GritsOpenGL *opengl)
        float light_diffuse[]  = {2.0f, 2.0f, 2.0f, 1.0f};
 #else
        float light_ambient[]  = {0.2f, 0.2f, 0.2f, 1.0f};
-       float light_diffuse[]  = {5.0f, 5.0f, 5.0f, 1.0f};
+       float light_diffuse[]  = {0.8f, 0.8f, 0.8f, 1.0f};
 #endif
        float light_position[] = {-13*EARTH_R, 1*EARTH_R, 3*EARTH_R, 1.0f};
        glLightfv(GL_LIGHT0, GL_AMBIENT,  light_ambient);
@@ -76,9 +76,9 @@ static void _set_visuals(GritsOpenGL *opengl)
        glEnable(GL_LIGHT0);
        glEnable(GL_LIGHTING);
 
-       float material_ambient[]  = {0.2, 0.2, 0.2, 1.0};
-       float material_diffuse[]  = {0.8, 0.8, 0.8, 1.0};
-       float material_specular[] = {0.1, 0.1, 0.1, 1.0};
+       float material_ambient[]  = {1.0, 1.0, 1.0, 1.0};
+       float material_diffuse[]  = {1.0, 1.0, 1.0, 1.0};
+       float material_specular[] = {0.0, 0.0, 0.0, 1.0};
        float material_emission[] = {0.0, 0.0, 0.0, 1.0};
        glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT,  material_ambient);
        glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE,  material_diffuse);
@@ -201,6 +201,7 @@ static gboolean on_expose(GritsOpenGL *opengl, GdkEventExpose *event, gpointer _
                glClear(GL_DEPTH_BUFFER_BIT);
                glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
                roam_sphere_draw(opengl->sphere);
+               g_tree_foreach(opengl->objects, _draw_level, opengl);
        }
        g_mutex_unlock(opengl->objects_lock);
 #endif
@@ -413,16 +414,16 @@ static GritsObject *grits_opengl_remove(GritsViewer *_opengl, gpointer _link)
 {
        g_assert(GRITS_IS_OPENGL(_opengl));
        GritsOpenGL *opengl = GRITS_OPENGL(_opengl);
-       g_mutex_lock(opengl->objects_lock);
        GList *link = _link;
+       g_mutex_lock(opengl->objects_lock);
        GritsObject *object = link->data;
        /* Just unlink and free it, link->prev is assured */
        link->prev->next = link->next;
        if (link->next)
                link->next->prev = link->prev;
+       g_mutex_unlock(opengl->objects_lock);
        g_free(link);
        g_object_unref(object);
-       g_mutex_unlock(opengl->objects_lock);
        return object;
 }