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);
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);
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
{
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;
}