Create win32_has_focus

This commit is contained in:
twinaphex 2015-11-17 08:58:49 +01:00
parent b5929e800f
commit 3d6f6869f0
5 changed files with 20 additions and 20 deletions

View File

@ -670,3 +670,18 @@ bool win32_set_video_mode(void *data,
return true;
}
#ifdef _XBOX
static HANDLE GetFocus(void)
{
return g_hwnd;
}
#endif
bool win32_has_focus(void *data)
{
if (!g_inited)
return false;
return GetFocus() == g_hwnd;
}

View File

@ -75,6 +75,8 @@ bool win32_get_metrics(void *data,
void win32_show_cursor(bool state);
bool win32_has_focus(void *data);
void win32_check_window(bool *quit,
bool *resize, unsigned *width, unsigned *height);

View File

@ -124,21 +124,9 @@ static void gfx_ctx_d3d_check_window(void *data, bool *quit,
win32_check_window(quit, resize, width, height);
}
#ifdef _XBOX
static HANDLE GetFocus(void)
{
driver_t *driver = driver_get_ptr();
d3d_video_t *d3d = (d3d_video_t*)driver->video_data;
return d3d->hWnd;
}
#endif
static bool gfx_ctx_d3d_has_focus(void *data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
if (!d3d)
return false;
return GetFocus() == g_hwnd;
return win32_has_focus();
}
static bool gfx_ctx_d3d_suppress_screensaver(void *data, bool enable)

View File

@ -397,12 +397,7 @@ static void gfx_ctx_wgl_input_driver(void *data,
static bool gfx_ctx_wgl_has_focus(void *data)
{
(void)data;
if (!g_inited)
return false;
return GetFocus() == g_hwnd;
return win32_has_focus();
}
static bool gfx_ctx_wgl_suppress_screensaver(void *data, bool enable)

View File

@ -53,7 +53,7 @@ typedef struct video_info
bool smooth;
/* Maximum input size: RARCH_SCALE_BASE * input_scale */
unsigned input_scale;
/* Use 32bit RGBA rather than native XBGR1555. */
/* Use 32bit RGBA rather than native RGB565/XBGR1555. */
bool rgb32;
} video_info_t;