Index: code/sdl/sdl_glimp.c =================================================================== --- code/sdl/sdl_glimp.c (revision 1515) +++ code/sdl/sdl_glimp.c (working copy) @@ -668,22 +668,29 @@ Sys_GLimpInit( ); // create the window and set up the context - if( !GLimp_StartDriverAndSetMode( r_mode->integer, r_fullscreen->integer ) ) + if( GLimp_StartDriverAndSetMode( r_mode->integer, r_fullscreen->integer ) ) + goto success; + + // Try again, this time in a platform specific "safe mode" + Sys_GLimpSafeInit( ); + + if( GLimp_StartDriverAndSetMode( r_mode->integer, r_fullscreen->integer ) ) + goto success; + + // Finally, try the default screen resolution + if( r_mode->integer != R_MODE_FALLBACK ) { - if( r_mode->integer != R_MODE_FALLBACK ) - { - ri.Printf( PRINT_ALL, "Setting r_mode %d failed, falling back on r_mode %d\n", - r_mode->integer, R_MODE_FALLBACK ); - if( !GLimp_StartDriverAndSetMode( R_MODE_FALLBACK, r_fullscreen->integer ) ) - success = qfalse; - } - else - success = qfalse; + ri.Printf( PRINT_ALL, "Setting r_mode %d failed, falling back on r_mode %d\n", + r_mode->integer, R_MODE_FALLBACK ); + + if( GLimp_StartDriverAndSetMode( R_MODE_FALLBACK, r_fullscreen->integer ) ) + goto success; } - if( !success ) - ri.Error( ERR_FATAL, "GLimp_Init() - could not load OpenGL subsystem\n" ); + // Nothing worked, give up + ri.Error( ERR_FATAL, "GLimp_Init() - could not load OpenGL subsystem\n" ); +success: // This values force the UI to disable driver selection glConfig.driverType = GLDRV_ICD; glConfig.hardwareType = GLHW_GENERIC; Index: code/sys/sys_win32.c =================================================================== --- code/sys/sys_win32.c (revision 1515) +++ code/sys/sys_win32.c (working copy) @@ -583,6 +583,25 @@ /* ============== +Sys_GLimpSafeInit + +Windows specific "safe" GL implementation initialisation +============== +*/ +void Sys_GLimpSafeInit( void ) +{ +#ifndef DEDICATED + if( !SDL_VIDEODRIVER_externallySet ) + { + // Here, we want to let SDL decide what do to unless + // explicitly requested otherwise + _putenv( "SDL_VIDEODRIVER=" ); + } +#endif +} + +/* +============== Sys_GLimpInit Windows specific GL implementation initialisation Index: code/sys/sys_unix.c =================================================================== --- code/sys/sys_unix.c (revision 1515) +++ code/sys/sys_unix.c (working copy) @@ -518,6 +518,18 @@ /* ============== +Sys_GLimpSafeInit + +Unix specific "safe" GL implementation initialisation +============== +*/ +void Sys_GLimpSafeInit( void ) +{ + // NOP +} + +/* +============== Sys_GLimpInit Unix specific GL implementation initialisation Index: code/sys/sys_local.h =================================================================== --- code/sys/sys_local.h (revision 1515) +++ code/sys/sys_local.h (working copy) @@ -48,6 +48,7 @@ char *Sys_StripAppBundle( char *pwd ); #endif +void Sys_GLimpSafeInit( void ); void Sys_GLimpInit( void ); void Sys_PlatformInit( void ); void Sys_SigHandler( int signal );