diff options
author | chai <chaifix@163.com> | 2018-10-05 15:40:31 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-10-05 15:40:31 +0800 |
commit | 789895b4b9f99668b8b772f271d07d1ce3115742 (patch) | |
tree | 3ae85381358445b2c29c9a0afb59375de9a7ce66 /src/libjin/Graphics/Window.cpp | |
parent | 846d6ab0ec1033481574e8324a43fc547ecf5882 (diff) |
*update
Diffstat (limited to 'src/libjin/Graphics/Window.cpp')
-rw-r--r-- | src/libjin/Graphics/Window.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/libjin/Graphics/Window.cpp b/src/libjin/Graphics/Window.cpp index 1fb60cc..6ebc9f9 100644 --- a/src/libjin/Graphics/Window.cpp +++ b/src/libjin/Graphics/Window.cpp @@ -1,10 +1,11 @@ -#include "../modules.h" +#include "../jin_configuration.h" #if LIBJIN_MODULES_RENDER #include <iostream> #include "window.h" -#include "../3rdparty/GLee/GLee.h" +#include "OpenGL.h" #include "canvas.h" +#include "Shader.h" #include "../utils/utils.h" #include "../audio/sdl/SDLAudio.h" #include "../utils/log.h" @@ -68,23 +69,24 @@ namespace graphics SDL_GL_SetSwapInterval(vsync ? 1 : 0); SDL_GL_MakeCurrent(wnd, ctx); /* default configuration */ - glClearColor(0.f, 0.f, 0.f, 1.f); - glColor4f(1, 1, 1, 1); - glEnable(GL_BLEND); - glEnable(GL_TEXTURE_2D); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + gl.setClearColor(0, 0, 0, 0xff); + 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); /* avoid white screen blink on windows */ swapBuffers(); /* bind to default canvas */ Canvas::unbind(); + Shader::unuse(); return true; } void Window::quitSystem() { /* disable opengl */ - glDisable(GL_BLEND); - glDisable(GL_TEXTURE_2D); + gl.disable(GL_BLEND); + gl.disable(GL_TEXTURE_2D); /* close window */ SDL_DestroyWindow(wnd); SDL_Quit(); |