diff options
Diffstat (limited to 'src/libjin/Graphics/Window.cpp')
-rw-r--r-- | src/libjin/Graphics/Window.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libjin/Graphics/Window.cpp b/src/libjin/Graphics/Window.cpp index e5f32ba..8d42bbf 100644 --- a/src/libjin/Graphics/Window.cpp +++ b/src/libjin/Graphics/Window.cpp @@ -67,15 +67,16 @@ namespace graphics return false; SDL_GL_SetSwapInterval(vsync ? 1 : 0); SDL_GL_MakeCurrent(wnd, ctx); + /* default configuration */ glClearColor(0.f, 0.f, 0.f, 1.f); - glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); glColor4f(1, 1, 1, 1); - glEnable(GL_BLEND); + glEnable(GL_TEXTURE_2D); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - Canvas::unbind(); + /* avoid white screen blink on windows */ swapBuffers(); + /* bind to default canvas */ + Canvas::unbind(); return true; } @@ -85,7 +86,7 @@ namespace graphics SDL_Quit(); } - inline void Window::swapBuffers() + void Window::swapBuffers() { if (wnd) SDL_GL_SwapWindow(wnd); |