diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index f68e1d48b1..4a31f7ba26 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -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; +} diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index f9c4015c18..56dbef27b2 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -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); diff --git a/gfx/drivers_context/d3d_ctx.cpp b/gfx/drivers_context/d3d_ctx.cpp index 1ab7fe2720..bb0bb44c3e 100644 --- a/gfx/drivers_context/d3d_ctx.cpp +++ b/gfx/drivers_context/d3d_ctx.cpp @@ -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) diff --git a/gfx/drivers_context/wgl_ctx.cpp b/gfx/drivers_context/wgl_ctx.cpp index d8410929e7..0e397fd5c3 100644 --- a/gfx/drivers_context/wgl_ctx.cpp +++ b/gfx/drivers_context/wgl_ctx.cpp @@ -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) diff --git a/gfx/video_driver.h b/gfx/video_driver.h index fd9d6f0004..2510232c4e 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -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;