aboutsummaryrefslogtreecommitdiffstats
path: root/code/unix
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-01-25 17:57:53 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-01-25 17:57:53 +0000
commit8ab0b9c277ed99d93c2d5b76ceeb30078ac85f11 (patch)
tree553101d21e188e08f115cb8ebd8fb502b3ac4e05 /code/unix
parentb07085058a2fd07241a9d3035de1442aa2a086ba (diff)
downloadioquake3-aero-8ab0b9c277ed99d93c2d5b76ceeb30078ac85f11.tar.gz
ioquake3-aero-8ab0b9c277ed99d93c2d5b76ceeb30078ac85f11.zip
* SDL build no longer requires a vid_restart when changing r_fullscreen
git-svn-id: svn://svn.icculus.org/quake3/trunk@526 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/unix')
-rw-r--r--code/unix/sdl_glimp.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/code/unix/sdl_glimp.c b/code/unix/sdl_glimp.c
index 75dc010..db77e14 100644
--- a/code/unix/sdl_glimp.c
+++ b/code/unix/sdl_glimp.c
@@ -1040,6 +1040,34 @@ void GLimp_EndFrame (void)
SDL_GL_SwapBuffers();
}
+ if( r_fullscreen->modified )
+ {
+ qboolean fullscreen;
+ qboolean sdlToggled = qfalse;
+ SDL_Surface *s = SDL_GetVideoSurface( );
+
+ if( s )
+ {
+ // Find out the current state
+ if( s->flags & SDL_FULLSCREEN )
+ fullscreen = qtrue;
+ else
+ fullscreen = qfalse;
+
+ // Is the state we want different from the current state?
+ if( !!r_fullscreen->integer != fullscreen )
+ sdlToggled = SDL_WM_ToggleFullScreen( s );
+ else
+ sdlToggled = qtrue;
+ }
+
+ // SDL_WM_ToggleFullScreen didn't work, so do it the slow way
+ if( !sdlToggled )
+ Cbuf_AddText( "vid_restart" );
+
+ r_fullscreen->modified = qfalse;
+ }
+
// check logging
QGL_EnableLogging( (qboolean)r_logFile->integer ); // bk001205 - was ->value
}