From 6041bb0a43dc112e56e34f8d032de124c34d35c4 Mon Sep 17 00:00:00 2001 From: mittorn Date: Fri, 13 Oct 2023 05:02:06 +0300 Subject: [PATCH] platform/sdl: fix safegl --- engine/platform/sdl/vid_sdl.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/engine/platform/sdl/vid_sdl.c b/engine/platform/sdl/vid_sdl.c index 501ac20e..3c633219 100644 --- a/engine/platform/sdl/vid_sdl.c +++ b/engine/platform/sdl/vid_sdl.c @@ -812,8 +812,13 @@ qboolean VID_CreateWindow( int width, int height, window_mode_t window_mode ) { if( !glw_state.initialized ) { - if( !GL_CreateContext( )) - return false; + while( !GL_CreateContext( )) + { + glw_state.safe++; + if(glw_state.safe > SAFE_DONTCARE) + return false; + GL_SetupAttributes(); // re-choose attributes + } VID_StartupGamma(); }