src/scene.c

changeset 39
7cf310cc47cb
parent 38
6e5629ea4c5c
child 40
6c438be1a1fd
equal deleted inserted replaced
38:6e5629ea4c5c 39:7cf310cc47cb
100 behavior->func(node); 100 behavior->func(node);
101 behavior = behavior->next; 101 behavior = behavior->next;
102 } 102 }
103 103
104 // check if geometry needs update 104 // check if geometry needs update
105 if (node->need_full_update) { 105 if (node->need_graphics_update) {
106 assert(node->update_func != NULL); 106 assert(node->update_func != NULL);
107 node->need_full_update = false; 107 node->need_graphics_update = false;
108 node->update_func(node); 108 node->update_func(node);
109 } 109 }
110 if (node->need_transform_update) { 110 if (node->need_transform_update) {
111 assert(node->transform_update_func != NULL); 111 assert(node->transform_update_func != NULL);
112 node->need_transform_update = false; 112 node->need_transform_update = false;
148 AscCamera *camera = &scene->cameras[cam_id]; 148 AscCamera *camera = &scene->cameras[cam_id];
149 if (camera->update == NULL) continue; 149 if (camera->update == NULL) continue;
150 camera->update(camera); 150 camera->update(camera);
151 151
152 // for the NONE group, the draw func is expected to do everything 152 // for the NONE group, the draw func is expected to do everything
153 glEnable(GL_DEPTH_TEST);
154 glDisable(GL_BLEND);
153 asc_scene_draw_render_group(scene->rg_none); 155 asc_scene_draw_render_group(scene->rg_none);
154 156
155 // draw the FONTS group 157 // draw the FONTS group
158 glDisable(GL_DEPTH_TEST);
159 glEnable(GL_BLEND);
160 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
156 // TODO: see if we can really always ignore the view matrix 161 // TODO: see if we can really always ignore the view matrix
162 // TODO: compute render order for alpha blending to work correctly
157 glUseProgram(ASC_SHADER_FONT.base.id); 163 glUseProgram(ASC_SHADER_FONT.base.id);
158 glUniformMatrix4fv(ASC_SHADER_FONT.base.projection, 1, 164 glUniformMatrix4fv(ASC_SHADER_FONT.base.projection, 1,
159 GL_FALSE, camera->projection); 165 GL_FALSE, camera->projection);
160 asc_scene_draw_render_group(scene->rg_fonts); 166 asc_scene_draw_render_group(scene->rg_fonts);
161 } 167 }

mercurial