From: bones_was_here Date: Mon, 30 Oct 2023 11:25:11 +0000 (+1000) Subject: GL: display a more useful error dialog if context creation fails X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=838b57bb5d2085dbd5af5ff4b886edb909f5027a;p=xonotic%2Fdarkplaces.git 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 --- 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