src/window.c

changeset 41
df81d493716e
parent 39
7cf310cc47cb
child 44
b3da4096c607
equal deleted inserted replaced
40:6c438be1a1fd 41:df81d493716e
114 } else { 114 } else {
115 glewExperimental = GL_TRUE; 115 glewExperimental = GL_TRUE;
116 GLenum err = glewInit(); 116 GLenum err = glewInit();
117 if (err == GLEW_OK) { 117 if (err == GLEW_OK) {
118 SDL_GL_SetSwapInterval(settings->vsync); 118 SDL_GL_SetSwapInterval(settings->vsync);
119 glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
119 glEnable(GL_DEBUG_OUTPUT); 120 glEnable(GL_DEBUG_OUTPUT);
120 glDebugMessageCallback(asc_gl_debug_callback, NULL); 121 glDebugMessageCallback(asc_gl_debug_callback, NULL);
121 122
122 asc_dprintf("Window %u initialized", window->id); 123 asc_dprintf("Window %u initialized", window->id);
123 if (asc_primitives_init(&window->primitives)) { 124 if (asc_primitives_init(&window->primitives)) {
181 AscWindow const *active_window = asc_context.active_window; 182 AscWindow const *active_window = asc_context.active_window;
182 if (window != active_window) { 183 if (window != active_window) {
183 asc_window_activate(window); 184 asc_window_activate(window);
184 } 185 }
185 186
186 // Clear for new frame
187 glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
188 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
189
190 // Draw the UI 187 // Draw the UI
191 asc_scene_draw(&window->ui); 188 asc_scene_draw(&window->ui);
192 189
193 // Swap Buffers 190 // Swap Buffers
194 SDL_GL_SwapWindow(window->window); 191 SDL_GL_SwapWindow(window->window);

mercurial