aboutsummaryrefslogtreecommitdiffstats
path: root/code/unix/sdl_glimp.c
diff options
context:
space:
mode:
Diffstat (limited to 'code/unix/sdl_glimp.c')
-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
}