diff --git a/src/win32/hardware.cpp b/src/win32/hardware.cpp index 57abe59f95..58a611d3e7 100644 --- a/src/win32/hardware.cpp +++ b/src/win32/hardware.cpp @@ -53,6 +53,7 @@ EXTERN_CVAR (Bool, fullscreen) EXTERN_CVAR (Bool, swtruecolor) EXTERN_CVAR (Float, vid_winscale) EXTERN_CVAR (Bool, vid_forceddraw) +EXTERN_CVAR (Bool, win_borderless) CVAR(Int, win_x, -1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Int, win_y, -1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) @@ -413,6 +414,13 @@ void I_RestoreWindowedPos () } MoveWindow (Window, winx, winy, winw, winh, TRUE); + if (win_borderless && !Args->CheckParm("-0")) + { + LONG lStyle = GetWindowLong(Window, GWL_STYLE); + lStyle &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU); + SetWindowLong(Window, GWL_STYLE, lStyle); + SetWindowPos(Window, HWND_TOP, 0, 0, scrwidth, scrheight, 0); + } if (win_maximized && !Args->CheckParm("-0")) ShowWindow(Window, SW_MAXIMIZE); } @@ -432,6 +440,18 @@ CUSTOM_CVAR(Bool, swtruecolor, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITC } } +CUSTOM_CVAR(Bool, win_borderless, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) +{ + // Just reinit the window. Saves a lot of trouble. + if (!fullscreen) + { + NewWidth = screen->VideoWidth; + NewHeight = screen->VideoHeight; + NewBits = DisplayBits; + setmodeneeded = true; + } +} + CUSTOM_CVAR (Bool, fullscreen, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL) { NewWidth = screen->VideoWidth;