Expand win32_monitor_set_fullscreen

This commit is contained in:
libretroadmin 2024-04-06 22:16:00 +02:00
parent 92478a370e
commit a7f6dced8d

View File

@ -2326,7 +2326,7 @@ bool win32_suspend_screensaver(void *data, bool enable)
static bool win32_monitor_set_fullscreen(
unsigned width, unsigned height,
unsigned refresh, char *dev_name)
unsigned refresh, bool interlaced, char *dev_name)
{
DEVMODE devmode;
memset(&devmode, 0, sizeof(devmode));
@ -2334,9 +2334,12 @@ static bool win32_monitor_set_fullscreen(
devmode.dmPelsWidth = width;
devmode.dmPelsHeight = height;
devmode.dmDisplayFrequency = refresh;
devmode.dmDisplayFlags = interlaced ? DM_INTERLACED : 0;
devmode.dmFields = DM_PELSWIDTH
| DM_PELSHEIGHT
| DM_DISPLAYFREQUENCY;
if (interlaced)
devmode.dmFields |= DM_DISPLAYFLAGS;
return win32_change_display_settings(dev_name, &devmode,
CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL;
}
@ -2380,7 +2383,7 @@ void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use,
*style = WS_POPUP | WS_VISIBLE;
if (win32_monitor_set_fullscreen(*width, *height,
(int)refresh_rate, current_mon->szDevice))
(int)refresh_rate, false, current_mon->szDevice))
{
RARCH_LOG("[Video]: Fullscreen set to %ux%u @ %uHz on device %s.\n",
*width, *height, (int)refresh_rate, current_mon->szDevice);