From 281f8feabffd69928a0a0f08aa31f70b36f5e6bd Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 3 Nov 2018 21:11:41 +0800 Subject: =?UTF-8?q?*=E5=A2=9E=E5=8A=A0=E6=B8=B8=E6=88=8F=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Graphics/je_window.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/libjin/Graphics/je_window.cpp') diff --git a/src/libjin/Graphics/je_window.cpp b/src/libjin/Graphics/je_window.cpp index 7265898..86ccd29 100644 --- a/src/libjin/Graphics/je_window.cpp +++ b/src/libjin/Graphics/je_window.cpp @@ -70,15 +70,19 @@ namespace JinEngine return false; SDL_GL_SetSwapInterval(vsync ? 1 : 0); SDL_GL_MakeCurrent(mWnd, ctx); - // default configuration + // Default configuration gl.setClearColor(0, 0, 0, 0xff); - gl.pushColor(0xff, 0xff, 0xff, 0xff); + glClear(GL_COLOR_BUFFER_BIT); + gl.pushColor(0xff, 0xff, 0xff, 0xff); gl.enable(GL_BLEND); gl.enable(GL_TEXTURE_2D); gl.setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - // bind to default canvas + // Bind to default canvas Canvas::unbind(); Shader::unuse(); + // Avoid white blinnk. + swapBuffers(); + return true; } -- cgit v1.1-26-g67d0