From 838b57bb5d2085dbd5af5ff4b886edb909f5027a Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Mon, 30 Oct 2023 21:25:11 +1000 Subject: [PATCH] GL: display a more useful error dialog if context creation fails There's no need to repeatedly retry if context creation fails, the GPU and driver capabilities won't have changed. Signed-off-by: bones_was_here --- vid_sdl.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/vid_sdl.c b/vid_sdl.c index 710b430b..7f33a50f 100644 --- a/vid_sdl.c +++ b/vid_sdl.c @@ -1751,11 +1751,7 @@ static qbool VID_InitModeGL(viddef_mode_t *mode) context = SDL_GL_CreateContext(window); if (context == NULL) - { - Con_Printf(CON_ERROR "Failed to initialize OpenGL context: %s\n", SDL_GetError()); - VID_Shutdown(); - return false; - } + Sys_Error("Failed to initialize OpenGL context: %s\n", SDL_GetError()); GL_InitFunctions(); @@ -1770,11 +1766,7 @@ static qbool VID_InitModeGL(viddef_mode_t *mode) SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY); context = SDL_GL_CreateContext(window); if (context == NULL) - { - Con_Printf(CON_ERROR "Failed to initialize OpenGL context: %s\n", SDL_GetError()); - VID_Shutdown(); - return false; - } + Sys_Error("Failed to initialize OpenGL context: %s\n", SDL_GetError()); } #endif -- 2.39.2