From b4e1be5beece2d8380871ab062d4359e2a2aa936 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 28 Oct 2024 16:35:44 +0100 Subject: [PATCH] dont always call HWR_Startup again --- src/sdl/ogl_sdl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index 4adc3dae8..ebd9ab8c1 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -112,10 +112,11 @@ boolean LoadGL(void) \return if true, changed video mode */ +static boolean first_init = false; + boolean OglSdlSurface(INT32 w, INT32 h) { INT32 cbpp = cv_scr_depth.value < 16 ? 16 : cv_scr_depth.value; - static boolean first_init = false; const char *gllogdir = NULL; oglflags = 0; @@ -180,7 +181,6 @@ boolean OglSdlSurface(INT32 w, INT32 h) #endif #endif } - first_init = true; SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0); @@ -214,9 +214,12 @@ boolean OglSdlSurface(INT32 w, INT32 h) GLFramebuffer_Disable(); #endif - HWR_Startup(); + if (!first_init) + HWR_Startup(); textureformatGL = cbpp > 16 ? GL_RGBA : GL_RGB5_A1; + first_init = true; + return true; }