Index: code/qcommon/common.c =================================================================== --- code/qcommon/common.c (revision 1635) +++ code/qcommon/common.c (working copy) @@ -83,6 +83,7 @@ cvar_t *com_minimized; cvar_t *com_maxfpsMinimized; cvar_t *com_standalone; +cvar_t *com_noborder; // com_speeds times int time_game; @@ -2629,6 +2630,8 @@ com_minimized = Cvar_Get( "com_minimized", "0", CVAR_ROM ); com_maxfpsMinimized = Cvar_Get( "com_maxfpsMinimized", "0", CVAR_ARCHIVE ); com_standalone = Cvar_Get( "com_standalone", "0", CVAR_INIT ); + + com_noborder = Cvar_Get( "com_noborder", "0", CVAR_ARCHIVE ); com_introPlayed = Cvar_Get( "com_introplayed", "0", CVAR_ARCHIVE); Index: code/qcommon/qcommon.h =================================================================== --- code/qcommon/qcommon.h (revision 1635) +++ code/qcommon/qcommon.h (working copy) @@ -828,6 +828,7 @@ extern cvar_t *com_minimized; extern cvar_t *com_maxfpsMinimized; extern cvar_t *com_altivec; +extern cvar_t *com_noborder; // both client and server must agree to pause extern cvar_t *cl_paused; Index: code/sdl/sdl_glimp.c =================================================================== --- code/sdl/sdl_glimp.c (revision 1635) +++ code/sdl/sdl_glimp.c (working copy) @@ -203,7 +203,7 @@ GLimp_SetMode =============== */ -static int GLimp_SetMode( int mode, qboolean fullscreen ) +static int GLimp_SetMode( int mode, qboolean fullscreen, qboolean noborder ) { const char* glstring; int sdlcolorbits; @@ -263,7 +263,17 @@ glConfig.isFullscreen = qtrue; } else + { + if (noborder) + { + flags |= SDL_NOFRAME; + } + else + { + flags &= ~SDL_NOFRAME; + } glConfig.isFullscreen = qfalse; + } colorbits = r_colorbits->value; if ((!colorbits) || (colorbits >= 32)) @@ -442,7 +452,7 @@ GLimp_StartDriverAndSetMode =============== */ -static qboolean GLimp_StartDriverAndSetMode( int mode, qboolean fullscreen ) +static qboolean GLimp_StartDriverAndSetMode( int mode, qboolean fullscreen, qboolean noborder ) { rserr_t err; @@ -469,8 +479,16 @@ r_fullscreen->modified = qfalse; fullscreen = qfalse; } + + if (noborder && fullscreen) + { + ri.Printf( PRINT_ALL, "Noborder not allowed with Fullscreen\n"); + ri.Cvar_Set( "com_noborder", "0" ); + com_noborder->modified = qfalse; + noborder = qfalse; + } - err = GLimp_SetMode( mode, fullscreen ); + err = GLimp_SetMode( mode, fullscreen, noborder ); switch ( err ) { @@ -683,13 +701,13 @@ 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, com_noborder->integer ) ) goto success; // Try again, this time in a platform specific "safe mode" Sys_GLimpSafeInit( ); - if( GLimp_StartDriverAndSetMode( r_mode->integer, r_fullscreen->integer ) ) + if( GLimp_StartDriverAndSetMode( r_mode->integer, r_fullscreen->integer, com_noborder->integer ) ) goto success; // Finally, try the default screen resolution @@ -698,7 +716,7 @@ 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 ) ) + if( GLimp_StartDriverAndSetMode( R_MODE_FALLBACK, r_fullscreen->integer, com_noborder->integer ) ) goto success; } Index: code/sys/sys_unix.c =================================================================== --- code/sys/sys_unix.c (revision 1635) +++ code/sys/sys_unix.c (working copy) @@ -565,7 +565,17 @@ */ void Sys_GLimpInit( void ) { - // NOP + if( Cvar_VariableIntegerValue( "com_noborder" ) == 1 ) + { + // Is Put and get really both needed? I did some + // searching on the net and people were saying they + // could not get this to work without both. + _putenv("SDL_VIDEO_WINDOW_POS"); + _putenv("SDL_VIDEO_CENTERED=1"); + + getenv("SDL_VIDEO_WINDOW_POS"); + getenv("SDL_VIDEO_CENTERED"); + } } /* Index: code/sys/sys_win32.c =================================================================== --- code/sys/sys_win32.c (revision 1635) +++ code/sys/sys_win32.c (working copy) @@ -597,6 +597,18 @@ // explicitly requested otherwise _putenv( "SDL_VIDEODRIVER=" ); } + + if( Cvar_VariableIntegerValue( "com_noborder" ) == 1 ) + { + // Is Put and get really both needed? I did some + // searching on the net and people were saying they + // could not get this to work without both. + _putenv("SDL_VIDEO_WINDOW_POS"); + _putenv("SDL_VIDEO_CENTERED=1"); + + getenv("SDL_VIDEO_WINDOW_POS"); + getenv("SDL_VIDEO_CENTERED"); + } #endif } @@ -627,6 +639,18 @@ _putenv( "SDL_VIDEODRIVER=directx" ); } } + + if( Cvar_VariableIntegerValue( "com_noborder" ) == 1 ) + { + // Is Put and get really both needed? I did some + // searching on the net and people were saying they + // could not get this to work without both. + _putenv("SDL_VIDEO_WINDOW_POS"); + _putenv("SDL_VIDEO_CENTERED=1"); + + getenv("SDL_VIDEO_WINDOW_POS"); + getenv("SDL_VIDEO_CENTERED"); + } #endif }