From de34c18f4daacd4f99a34623f8f061f6ccc903f5 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Tue, 3 Oct 2023 18:32:04 +1000 Subject: [PATCH] VID_InitModeGL(): fix clear to black of new window The window was left with whatever was already in the framebuffer. Also we can perform the clear a bit earlier. Changes initial state of vid_activewindow to match the logic that sets it during normal frames. Signed-off-by: bones_was_here --- vid_sdl.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/vid_sdl.c b/vid_sdl.c index 6f71d29b..7cee4def 100644 --- a/vid_sdl.c +++ b/vid_sdl.c @@ -1619,6 +1619,16 @@ static qbool VID_InitModeGL(viddef_mode_t *mode) SDL_GL_SetSwapInterval(bound(-1, vid_vsync.integer, 1)); vid_usingvsync = (vid_vsync.integer != 0); + vid_hidden = false; + vid_activewindow = true; + vid_hasfocus = true; + vid_usingmouse = false; + vid_usinghidecursor = false; + + // clear to black (loading plaque will be seen over this) + GL_Clear(GL_COLOR_BUFFER_BIT, NULL, 1.0f, 0); + VID_Finish(); // checks vid_hidden + GL_Setup(); // VorteX: set other info @@ -1628,15 +1638,6 @@ static qbool VID_InitModeGL(viddef_mode_t *mode) Cvar_SetQuick(&gl_info_platform, "SDL"); Cvar_SetQuick(&gl_info_driver, drivername ? drivername : ""); - // clear to black (loading plaque will be seen over this) - GL_Clear(GL_COLOR_BUFFER_BIT, NULL, 1.0f, 0); - - vid_hidden = false; - vid_activewindow = false; - vid_hasfocus = true; - vid_usingmouse = false; - vid_usinghidecursor = false; - return true; } -- 2.39.2