mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
- make the non-fullscreen window default to 80% of the current display size on Windows.
This commit is contained in:
parent
d58fe1f78a
commit
843e9e950f
2 changed files with 12 additions and 6 deletions
|
@ -71,7 +71,6 @@ EXTERN_CVAR(Int, vid_defheight)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
|
@ -278,14 +277,14 @@ void SystemBaseFrameBuffer::SetWindowSize(int w, int h)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void SystemBaseFrameBuffer::PositionWindow(bool fullscreen)
|
||||
void SystemBaseFrameBuffer::PositionWindow(bool fullscreen, bool initialcall)
|
||||
{
|
||||
RECT r;
|
||||
LONG style, exStyle;
|
||||
|
||||
RECT monRect;
|
||||
|
||||
if (!m_Fullscreen && fullscreen) SaveWindowedPos();
|
||||
if (!m_Fullscreen && fullscreen && !initialcall) SaveWindowedPos();
|
||||
if (m_Monitor)
|
||||
{
|
||||
MONITORINFOEX mi;
|
||||
|
@ -296,6 +295,13 @@ void SystemBaseFrameBuffer::PositionWindow(bool fullscreen)
|
|||
strcpy(m_displayDeviceNameBuffer, mi.szDevice);
|
||||
m_displayDeviceName = m_displayDeviceNameBuffer;
|
||||
monRect = mi.rcMonitor;
|
||||
|
||||
// Set the default windowed size if not specified yet.
|
||||
if (win_w < 0 || win_h < 0)
|
||||
{
|
||||
win_w = int(monRect.right - monRect.left) * 8 / 10;
|
||||
win_h = int(monRect.bottom - monRect.top) * 8 / 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -347,7 +353,7 @@ SystemBaseFrameBuffer::SystemBaseFrameBuffer(void *hMonitor, bool fullscreen) :
|
|||
{
|
||||
m_Monitor = hMonitor;
|
||||
m_displayDeviceName = 0;
|
||||
PositionWindow(fullscreen);
|
||||
PositionWindow(fullscreen, true);
|
||||
|
||||
HDC hDC = GetDC(Window);
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ class SystemBaseFrameBuffer : public DFrameBuffer
|
|||
void RestoreWindowedPos();
|
||||
|
||||
public:
|
||||
SystemBaseFrameBuffer() {}
|
||||
SystemBaseFrameBuffer();
|
||||
// Actually, hMonitor is a HMONITOR, but it's passed as a void * as there
|
||||
// look to be some cross-platform bits in the way.
|
||||
SystemBaseFrameBuffer(void *hMonitor, bool fullscreen);
|
||||
|
@ -28,7 +28,7 @@ protected:
|
|||
void GetCenteredPos(int in_w, int in_h, int &winx, int &winy, int &winw, int &winh, int &scrwidth, int &scrheight);
|
||||
void KeepWindowOnScreen(int &winx, int &winy, int winw, int winh, int scrwidth, int scrheight);
|
||||
|
||||
void PositionWindow(bool fullscreen);
|
||||
void PositionWindow(bool fullscreen, bool initialcall = false);
|
||||
|
||||
void ResetGammaTable();
|
||||
void SetGammaTable(uint16_t * tbl);
|
||||
|
|
Loading…
Reference in a new issue