aboutsummaryrefslogtreecommitdiff
path: root/src/libui_sdl
diff options
context:
space:
mode:
Diffstat (limited to 'src/libui_sdl')
-rw-r--r--src/libui_sdl/main.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp
index d606be6..1696c2e 100644
--- a/src/libui_sdl/main.cpp
+++ b/src/libui_sdl/main.cpp
@@ -289,6 +289,8 @@ void GLScreen_DrawScreen()
{
float scale = uiGLGetFramebufferScale(GLContext);
+ glBindFramebuffer(GL_FRAMEBUFFER, uiGLGetFramebuffer(GLContext));
+
if (GL_ScreenSizeDirty)
{
GL_ScreenSizeDirty = false;
@@ -424,8 +426,6 @@ void GLScreen_DrawScreen()
else
OpenGL_UseShaderProgram(GL_ScreenShaderAccel);
- glBindFramebuffer(GL_FRAMEBUFFER, uiGLGetFramebuffer(GLContext));
-
glClearColor(0, 0, 0, 1);
glClear(GL_COLOR_BUFFER_BIT);
@@ -2151,26 +2151,17 @@ void ApplyNewSettings(int type)
bool usegl = Config::ScreenUseGL || (Config::_3DRenderer != 0);
if (usegl != Screen_UseGL)
{
- if (RunningSomething)
- {
- if (Screen_UseGL) uiGLMakeContextCurrent(GLContext);
- GPU3D::DeInitRenderer();
- if (Screen_UseGL) uiGLMakeContextCurrent(NULL);
- }
-
if (Screen_UseGL) uiGLMakeContextCurrent(GLContext);
+ GPU3D::DeInitRenderer();
OSD::DeInit(Screen_UseGL);
if (Screen_UseGL) uiGLMakeContextCurrent(NULL);
Screen_UseGL = usegl;
RecreateMainWindow(usegl);
- if (RunningSomething)
- {
- if (Screen_UseGL) uiGLMakeContextCurrent(GLContext);
- GPU3D::InitRenderer(Screen_UseGL);
- if (Screen_UseGL) uiGLMakeContextCurrent(NULL);
- }
+ if (Screen_UseGL) uiGLMakeContextCurrent(GLContext);
+ GPU3D::InitRenderer(Screen_UseGL);
+ if (Screen_UseGL) uiGLMakeContextCurrent(NULL);
}
}
else if (type == 3) // 3D renderer