From 8ab0b9c277ed99d93c2d5b76ceeb30078ac85f11 Mon Sep 17 00:00:00 2001 From: tma Date: Wed, 25 Jan 2006 17:57:53 +0000 Subject: * 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 --- code/unix/sdl_glimp.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'code/unix') 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 } -- cgit v1.2.3