src/window.c

changeset 262
b47de42f4598
parent 257
67d7b79997df
equal deleted inserted replaced
261:bfd15f5a3948 262:b47de42f4598
141 int window_width = window->dimensions.width; 141 int window_width = window->dimensions.width;
142 int window_height = window->dimensions.height; 142 int window_height = window->dimensions.height;
143 glViewport(0, 0, window_width, window_height); 143 glViewport(0, 0, window_width, window_height);
144 glClear(GL_COLOR_BUFFER_BIT); 144 glClear(GL_COLOR_BUFFER_BIT);
145 145
146 // Update the viewports when the window resized
147 if (window->resized) {
148 for (unsigned int i = 0; i < ASC_MAX_SCENES; i++) {
149 if (asc_scene_active(&window->scenes[i])) {
150 asc_camera_update_viewport(&window->scenes[i].camera, window->dimensions);
151 }
152 }
153 asc_camera_update_viewport(&window->ui.camera, window->dimensions);
154 }
155
146 // Execute all behaviors 156 // Execute all behaviors
147 // TODO: this can eventually be parallelized 157 // TODO: this can eventually be parallelized
148 for (unsigned int i = 0; i < ASC_MAX_SCENES; i++) { 158 for (unsigned int i = 0; i < ASC_MAX_SCENES; i++) {
149 asc_scene_execute_behaviors(&window->scenes[i]); 159 asc_scene_execute_behaviors(&window->scenes[i]);
150 } 160 }

mercurial