mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(D3D) Move code up
This commit is contained in:
parent
3f77a9b745
commit
d2e778b3f6
@ -581,6 +581,53 @@ static void d3d_set_osd_msg(void *data, const char *msg,
|
|||||||
font_ctx->render_msg(driver->font_osd_data, msg, params);
|
font_ctx->render_msg(driver->font_osd_data, msg, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_MONITOR
|
||||||
|
static BOOL CALLBACK d3d_monitor_enum_proc(HMONITOR hMonitor,
|
||||||
|
HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
|
||||||
|
{
|
||||||
|
monitor_d3d_all[monitor_d3d_count++] = hMonitor;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Multi-monitor support. */
|
||||||
|
static void d3d_monitor_rect(d3d_video_t *d3d, MONITORINFOEX *mon, HMONITOR *hm_to_use)
|
||||||
|
{
|
||||||
|
unsigned fs_monitor, i;
|
||||||
|
monitor_d3d_count = 0;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
|
|
||||||
|
if (!monitor_d3d_last)
|
||||||
|
monitor_d3d_last = MonitorFromWindow(
|
||||||
|
GetDesktopWindow(), MONITOR_DEFAULTTONEAREST);
|
||||||
|
|
||||||
|
*hm_to_use = monitor_d3d_last;
|
||||||
|
fs_monitor = settings->video.monitor_index;
|
||||||
|
|
||||||
|
if (fs_monitor && fs_monitor <= monitor_d3d_count
|
||||||
|
&& monitor_d3d_all[fs_monitor - 1])
|
||||||
|
{
|
||||||
|
*hm_to_use = monitor_d3d_all[fs_monitor - 1];
|
||||||
|
d3d->cur_mon_id = fs_monitor - 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (i = 0; i < monitor_d3d_count; i++)
|
||||||
|
{
|
||||||
|
if (monitor_d3d_all[i] != *hm_to_use)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
d3d->cur_mon_id = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(mon, 0, sizeof(*mon));
|
||||||
|
mon->cbSize = sizeof(MONITORINFOEX);
|
||||||
|
GetMonitorInfo(*hm_to_use, (MONITORINFO*)mon);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Delay constructor due to lack of exceptions. */
|
/* Delay constructor due to lack of exceptions. */
|
||||||
|
|
||||||
static bool d3d_construct(d3d_video_t *d3d,
|
static bool d3d_construct(d3d_video_t *d3d,
|
||||||
@ -910,52 +957,6 @@ static void d3d_free(void *data)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_MONITOR
|
|
||||||
static BOOL CALLBACK d3d_monitor_enum_proc(HMONITOR hMonitor,
|
|
||||||
HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
|
|
||||||
{
|
|
||||||
monitor_d3d_all[monitor_d3d_count++] = hMonitor;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Multi-monitor support. */
|
|
||||||
static void d3d_monitor_rect(d3d_video_t *d3d, MONITORINFOEX *mon, HMONITOR *hm_to_use)
|
|
||||||
{
|
|
||||||
unsigned fs_monitor, i;
|
|
||||||
monitor_d3d_count = 0;
|
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
|
|
||||||
if (!monitor_d3d_last)
|
|
||||||
monitor_d3d_last = MonitorFromWindow(
|
|
||||||
GetDesktopWindow(), MONITOR_DEFAULTTONEAREST);
|
|
||||||
|
|
||||||
*hm_to_use = monitor_d3d_last;
|
|
||||||
fs_monitor = settings->video.monitor_index;
|
|
||||||
|
|
||||||
if (fs_monitor && fs_monitor <= monitor_d3d_count
|
|
||||||
&& monitor_d3d_all[fs_monitor - 1])
|
|
||||||
{
|
|
||||||
*hm_to_use = monitor_d3d_all[fs_monitor - 1];
|
|
||||||
d3d->cur_mon_id = fs_monitor - 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (i = 0; i < monitor_d3d_count; i++)
|
|
||||||
{
|
|
||||||
if (monitor_d3d_all[i] != *hm_to_use)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
d3d->cur_mon_id = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(mon, 0, sizeof(*mon));
|
|
||||||
mon->cbSize = sizeof(MONITORINFOEX);
|
|
||||||
GetMonitorInfo(*hm_to_use, (MONITORINFO*)mon);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef DONT_HAVE_STATE_TRACKER
|
#ifndef DONT_HAVE_STATE_TRACKER
|
||||||
static bool d3d_init_imports(d3d_video_t *d3d)
|
static bool d3d_init_imports(d3d_video_t *d3d)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user