diff --git a/engine/client/ref_common.c b/engine/client/ref_common.c index ddf0dc64..b235ef17 100644 --- a/engine/client/ref_common.c +++ b/engine/client/ref_common.c @@ -554,16 +554,12 @@ static void SetWidthAndHeightFromCommandLine( void ) static void SetFullscreenModeFromCommandLine( void ) { -#if !XASH_MOBILE_PLATFORM - if( Sys_CheckParm( "-fullscreen" )) - { + if( Sys_CheckParm( "-borderless" )) + Cvar_DirectSet( &vid_fullscreen, "2" ); + else if( Sys_CheckParm( "-fullscreen" )) Cvar_DirectSet( &vid_fullscreen, "1" ); - } else if( Sys_CheckParm( "-windowed" )) - { Cvar_DirectSet( &vid_fullscreen, "0" ); - } -#endif } static void R_CollectRendererNames( void ) diff --git a/engine/client/vid_common.c b/engine/client/vid_common.c index 5d270f80..8038ff81 100644 --- a/engine/client/vid_common.c +++ b/engine/client/vid_common.c @@ -30,7 +30,7 @@ static CVAR_DEFINE_AUTO( vid_scale, "1.0", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "p CVAR_DEFINE_AUTO( vid_highdpi, "1", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "enable High-DPI mode" ); CVAR_DEFINE_AUTO( vid_maximized, "0", FCVAR_RENDERINFO, "window maximized state, read-only" ); -CVAR_DEFINE( vid_fullscreen, "fullscreen", "0", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "enable fullscren mode" ); +CVAR_DEFINE( vid_fullscreen, "fullscreen", "0", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "fullscreen state (0 windowed, 1 fullscreen, 2 borderless)" ); CVAR_DEFINE( window_xpos, "_window_xpos", "-1", FCVAR_RENDERINFO, "window position by horizontal" ); CVAR_DEFINE( window_ypos, "_window_ypos", "-1", FCVAR_RENDERINFO, "window position by vertical" ); @@ -209,7 +209,7 @@ static void VID_Mode_f( void ) return; } - R_ChangeDisplaySettings( w, h, !!vid_fullscreen.value ); + R_ChangeDisplaySettings( w, h, bound( 0, vid_fullscreen.value, WINDOW_MODE_COUNT - 1 )); } void VID_Init( void ) diff --git a/engine/client/vid_common.h b/engine/client/vid_common.h index 6143229a..1f052f43 100644 --- a/engine/client/vid_common.h +++ b/engine/client/vid_common.h @@ -9,6 +9,13 @@ typedef struct vidmode_s int height; } vidmode_t; +typedef enum window_mode_e +{ + WINDOW_MODE_WINDOWED = 0, + WINDOW_MODE_FULLSCREEN, + WINDOW_MODE_BORDERLESS, + WINDOW_MODE_COUNT, +} window_mode_t; typedef struct { @@ -21,8 +28,6 @@ typedef struct qboolean initialized; // OpenGL subsystem started qboolean extended; // extended context allows to GL_Debug qboolean software; - - } glwstate_t; extern glwstate_t glw_state;