diff options
author | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2009-09-14 12:34:31 +0000 |
---|---|---|
committer | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2009-09-14 12:34:31 +0000 |
commit | bec584811a9ec5d525f2b31a58f40b2a58780caa (patch) | |
tree | bd364981109c9dcab9b3960740dc40c6fb97fde5 /code/sdl | |
parent | 02fe9c726bf077a9cf709593ac497888c572b819 (diff) | |
download | ioquake3-aero-bec584811a9ec5d525f2b31a58f40b2a58780caa.tar.gz ioquake3-aero-bec584811a9ec5d525f2b31a58f40b2a58780caa.zip |
* Fix warning in cl_main.c
* Fix bug #4026 (SDL dx backend doesn't work on some machines)
git-svn-id: svn://svn.icculus.org/quake3/trunk@1586 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/sdl')
-rw-r--r-- | code/sdl/sdl_glimp.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/code/sdl/sdl_glimp.c b/code/sdl/sdl_glimp.c index 0b143d7..ba08ade 100644 --- a/code/sdl/sdl_glimp.c +++ b/code/sdl/sdl_glimp.c @@ -665,31 +665,35 @@ of OpenGL */ void GLimp_Init( void ) { - qboolean success = qtrue; - r_allowSoftwareGL = ri.Cvar_Get( "r_allowSoftwareGL", "0", CVAR_LATCH ); r_sdlDriver = ri.Cvar_Get( "r_sdlDriver", "", CVAR_ROM ); Sys_GLimpInit( ); - // create the window and set up the context - if( !GLimp_StartDriverAndSetMode( r_mode->integer, r_fullscreen->integer ) ) + // Create the window and set up the context + 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 ); - ri.Cvar_Set("r_ext_multisample", "0"); - 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; |