1
0
forked from 0ad/0ad

Adds config settings for borderless fullscreen and window modes.

Tested By: bb, Langbart
Differential Revision: https://code.wildfiregames.com/D4106
This was SVN commit r26148.
This commit is contained in:
Vladislav Belov 2021-12-31 12:05:48 +00:00
parent 202e248c93
commit 7b8c66ec9f
2 changed files with 17 additions and 1 deletions

View File

@ -26,6 +26,11 @@
; Enable/disable windowed mode by default. (Use Alt+Enter to toggle in the game.)
windowed = false
; Switches between real fullscreen and borderless window on a full display size.
borderless.fullscreen = true
; Hides a window border in the windowed mode.
borderless.window = false
; Show detailed tooltips (Unit stats)
showdetailedtooltips = false

View File

@ -244,7 +244,18 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)
{
Uint32 flags = 0;
if (fullscreen)
flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
{
bool borderlessFullscreen = true;
CFG_GET_VAL("borderless.fullscreen", borderlessFullscreen);
flags |= borderlessFullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_FULLSCREEN;
}
else
{
bool borderlessWindow = false;
CFG_GET_VAL("borderless.window", borderlessWindow);
if (borderlessWindow)
flags |= SDL_WINDOW_BORDERLESS;
}
if (!m_Window)
{