mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
Create win32_change_display_settings
This commit is contained in:
parent
87cf910396
commit
359de5c84b
@ -256,6 +256,19 @@ void win32_monitor_from_window(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
int win32_change_display_settings(const char *str, void *devmode_data,
|
||||
unsigned flags)
|
||||
{
|
||||
#if _WIN32_WINDOWS >= 0x0410 || _WIN32_WINNT >= 0x0410
|
||||
/* Windows 98 and later codepath */
|
||||
return ChangeDisplaySettingsEx(str, (DEVMODE*)devmode_data,
|
||||
NULL, flags, NULL);
|
||||
#else
|
||||
/* Windows 95 / NT codepath */
|
||||
return ChangeDisplaySettings((DEVMODE*)devmode_data, flags);
|
||||
#endif
|
||||
}
|
||||
|
||||
void win32_monitor_get_info(void)
|
||||
{
|
||||
MONITORINFOEX current_mon;
|
||||
@ -265,13 +278,7 @@ void win32_monitor_get_info(void)
|
||||
|
||||
GetMonitorInfo(win32_monitor_last, (LPMONITORINFO)¤t_mon);
|
||||
|
||||
#if _WIN32_WINDOWS >= 0x0410 || _WIN32_WINNT >= 0x0410
|
||||
/* Windows 98 and later codepath */
|
||||
ChangeDisplaySettingsEx(current_mon.szDevice, NULL, NULL, 0, NULL);
|
||||
#else
|
||||
/* Windows 95 / NT codepath */
|
||||
ChangeDisplaySettings(NULL, 0);
|
||||
#endif
|
||||
win32_change_display_settings(current_mon.szDevice, NULL, 0);
|
||||
}
|
||||
|
||||
void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id)
|
||||
@ -902,14 +909,8 @@ static bool win32_monitor_set_fullscreen(
|
||||
RARCH_LOG("Setting fullscreen to %ux%u @ %uHz on device %s.\n",
|
||||
width, height, refresh, dev_name);
|
||||
|
||||
#if _WIN32_WINDOWS >= 0x0410 || _WIN32_WINNT >= 0x0410
|
||||
/* Windows 98 and later codepath */
|
||||
return ChangeDisplaySettingsEx(dev_name, &devmode,
|
||||
NULL, CDS_FULLSCREEN, NULL) == DISP_CHANGE_SUCCESSFUL;
|
||||
#else
|
||||
/* Windows 95 / NT codepath */
|
||||
return ChangeDisplaySettings(&devmode, CDS_FULLSCREEN);
|
||||
#endif
|
||||
return win32_change_display_settings(dev_name, &devmode,
|
||||
CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -56,6 +56,9 @@ void win32_monitor_get_info(void);
|
||||
|
||||
void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id);
|
||||
|
||||
int win32_change_display_settings(const char *str, void *devmode_data,
|
||||
unsigned flags);
|
||||
|
||||
void create_graphics_context(HWND hwnd, bool *quit);
|
||||
|
||||
void create_gdi_context(HWND hwnd, bool *quit);
|
||||
|
@ -21,7 +21,8 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#include <windows.h>
|
||||
#include "common/win32_common.h"
|
||||
#endif
|
||||
|
||||
#include "video_driver.h"
|
||||
@ -235,13 +236,15 @@ void crt_switch_res(int width, int height, int f_restore,int ra_hz)
|
||||
if (devmode.dmDisplayFrequency != freq)
|
||||
continue;
|
||||
|
||||
devmode.dmFields |= DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL | DM_DISPLAYFREQUENCY;
|
||||
res = ChangeDisplaySettings(&devmode, CDS_TEST);
|
||||
devmode.dmFields |=
|
||||
DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL | DM_DISPLAYFREQUENCY;
|
||||
res =
|
||||
win32_change_display_settings(NULL, &devmode, CDS_TEST);
|
||||
|
||||
switch (res)
|
||||
{
|
||||
case DISP_CHANGE_SUCCESSFUL:
|
||||
res = ChangeDisplaySettings(&devmode, flags);
|
||||
res = win32_change_display_settings(NULL, &devmode, flags);
|
||||
switch (res)
|
||||
{
|
||||
case DISP_CHANGE_SUCCESSFUL:
|
||||
|
Loading…
x
Reference in New Issue
Block a user