Skip to content

Commit 74eb201

Browse files
committed
always reset device on video mode change
needed to avoid scaling until restart due to difference in client size and render size
1 parent 5aef31f commit 74eb201

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

src/xrEngine/xr_ioc_cmd.cpp

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -566,35 +566,9 @@ class CCC_Screenmode : public CCC_Token
566566
// but the fixes make no sense and contradicts MSDN, and this isn't a major priority since ResizeBuffers is called
567567
// immediately after (before our Present call) so it works, just so stupid
568568

569-
bool windowed_to_fullscreen = ((prev_mode == 0) || (prev_mode == 1)) && (g_screenmode == 2);
570-
bool fullscreen_to_windowed = (prev_mode == 2) && ((g_screenmode == 0) || (g_screenmode == 1));
571-
bool reset_required = windowed_to_fullscreen || fullscreen_to_windowed;
572-
if (Device.b_is_Ready && reset_required) {
569+
if (Device.b_is_Ready) {
573570
Device.Reset();
574571
}
575-
576-
if (!reset_required)
577-
{
578-
u32 monW, monH;
579-
int monX, monY;
580-
GetMonitorResolution(monW, monH);
581-
GetMonitorPosition(monX, monY);
582-
DWORD style = g_screenmode == 0 ? WS_OVERLAPPEDWINDOW : WS_POPUP;
583-
SetWindowLongPtr(Device.m_hWnd, GWL_STYLE, WS_VISIBLE | style);
584-
585-
if (g_screenmode == 0)
586-
{
587-
LONG w = psCurrentVidMode[0];
588-
LONG h = psCurrentVidMode[1];
589-
int x = monX + (LONG(monW) - w) / 2;
590-
int y = monY + (LONG(monH) - h) / 2;
591-
SetWindowPos(Device.m_hWnd, HWND_TOP, x, y, w, h, SWP_FRAMECHANGED);
592-
}
593-
else
594-
{
595-
SetWindowPos(Device.m_hWnd, HWND_TOP, monX, monY, monW, monH, SWP_FRAMECHANGED);
596-
}
597-
}
598572
}
599573

600574
RECT winRect;

0 commit comments

Comments
 (0)