mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
(D3D) Get rid of monitor namespace
This commit is contained in:
parent
a22453278a
commit
b4e564ad60
@ -98,12 +98,9 @@ static RECT d3d_monitor_rect(d3d_video_t *d3d);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_MONITOR
|
#ifdef HAVE_MONITOR
|
||||||
namespace Monitor
|
static HMONITOR monitor_last;
|
||||||
{
|
static HMONITOR monitor_all[MAX_MONITORS];
|
||||||
static HMONITOR last_hm;
|
static unsigned monitor_count;
|
||||||
static HMONITOR all_hms[MAX_MONITORS];
|
|
||||||
static unsigned num_mons;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void d3d_deinit_shader(void *data)
|
static void d3d_deinit_shader(void *data)
|
||||||
@ -786,7 +783,7 @@ static void d3d_free(void *data)
|
|||||||
d3d->g_pD3D->Release();
|
d3d->g_pD3D->Release();
|
||||||
|
|
||||||
#ifdef HAVE_MONITOR
|
#ifdef HAVE_MONITOR
|
||||||
Monitor::last_hm = MonitorFromWindow(d3d->hWnd,
|
monitor_last = MonitorFromWindow(d3d->hWnd,
|
||||||
MONITOR_DEFAULTTONEAREST);
|
MONITOR_DEFAULTTONEAREST);
|
||||||
DestroyWindow(d3d->hWnd);
|
DestroyWindow(d3d->hWnd);
|
||||||
#endif
|
#endif
|
||||||
@ -809,7 +806,7 @@ static void d3d_free(void *data)
|
|||||||
static BOOL CALLBACK d3d_monitor_enum_proc(HMONITOR hMonitor,
|
static BOOL CALLBACK d3d_monitor_enum_proc(HMONITOR hMonitor,
|
||||||
HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
|
HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
|
||||||
{
|
{
|
||||||
Monitor::all_hms[Monitor::num_mons++] = hMonitor;
|
monitor_all[monitor_count++] = hMonitor;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -819,28 +816,28 @@ static RECT d3d_monitor_rect(d3d_video_t *d3d)
|
|||||||
unsigned fs_monitor, i;
|
unsigned fs_monitor, i;
|
||||||
MONITORINFOEX current_mon;
|
MONITORINFOEX current_mon;
|
||||||
HMONITOR hm_to_use;
|
HMONITOR hm_to_use;
|
||||||
Monitor::num_mons = 0;
|
monitor_count = 0;
|
||||||
|
|
||||||
EnumDisplayMonitors(NULL, NULL, d3d_monitor_enum_proc, 0);
|
EnumDisplayMonitors(NULL, NULL, d3d_monitor_enum_proc, 0);
|
||||||
|
|
||||||
if (!Monitor::last_hm)
|
if (!monitor_last)
|
||||||
Monitor::last_hm = MonitorFromWindow(
|
monitor_last = MonitorFromWindow(
|
||||||
GetDesktopWindow(), MONITOR_DEFAULTTONEAREST);
|
GetDesktopWindow(), MONITOR_DEFAULTTONEAREST);
|
||||||
|
|
||||||
hm_to_use = Monitor::last_hm;
|
hm_to_use = monitor_last;
|
||||||
fs_monitor = g_settings.video.monitor_index;
|
fs_monitor = g_settings.video.monitor_index;
|
||||||
|
|
||||||
if (fs_monitor && fs_monitor <= Monitor::num_mons
|
if (fs_monitor && fs_monitor <= monitor_count
|
||||||
&& Monitor::all_hms[fs_monitor - 1])
|
&& monitor_all[fs_monitor - 1])
|
||||||
{
|
{
|
||||||
hm_to_use = Monitor::all_hms[fs_monitor - 1];
|
hm_to_use = monitor_all[fs_monitor - 1];
|
||||||
d3d->cur_mon_id = fs_monitor - 1;
|
d3d->cur_mon_id = fs_monitor - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (i = 0; i < Monitor::num_mons; i++)
|
for (i = 0; i < monitor_count; i++)
|
||||||
{
|
{
|
||||||
if (Monitor::all_hms[i] != hm_to_use)
|
if (monitor_all[i] != hm_to_use)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
d3d->cur_mon_id = i;
|
d3d->cur_mon_id = i;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user