diff --git a/gfx/common/win32_common.c b/gfx/common/win32_common.c index 8b8f96c02a..74c0874943 100644 --- a/gfx/common/win32_common.c +++ b/gfx/common/win32_common.c @@ -1087,7 +1087,7 @@ static bool win32_monitor_set_fullscreen( #endif } -void win32_show_cursor(bool state) +void win32_show_cursor(void *data, bool state) { #if !defined(_XBOX) if (state) @@ -1291,7 +1291,7 @@ void win32_set_window(unsigned *width, unsigned *height, window->set_focused(&main_window); } - win32_show_cursor(!fullscreen); + win32_show_cursor(NULL, !fullscreen); #endif } diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index 7404d255df..254d2d9e63 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -92,7 +92,7 @@ bool win32_suppress_screensaver(void *data, bool enable); bool win32_get_metrics(void *data, enum display_metric_types type, float *value); -void win32_show_cursor(bool state); +void win32_show_cursor(void *data, bool state); HWND win32_get_window(void); diff --git a/gfx/drivers/d3d10.c b/gfx/drivers/d3d10.c index d650639e03..23b6d6bf6a 100644 --- a/gfx/drivers/d3d10.c +++ b/gfx/drivers/d3d10.c @@ -212,7 +212,7 @@ static void d3d10_overlay_enable(void* data, bool state) return; d3d10->overlays.enabled = state; - win32_show_cursor(state); + win32_show_cursor(d3d10, state); } static void d3d10_overlay_full_screen(void* data, bool enable) @@ -1647,8 +1647,6 @@ static void d3d10_gfx_set_osd_msg( } } -static void d3d10_gfx_show_mouse(void* data, bool state) { win32_show_cursor(state); } - static uintptr_t d3d10_gfx_load_texture( void* video_data, void* data, bool threaded, enum texture_filter_type filter_type) { @@ -1750,7 +1748,7 @@ static const video_poke_interface_t d3d10_poke_interface = { d3d10_set_menu_texture_frame, d3d10_set_menu_texture_enable, d3d10_gfx_set_osd_msg, - d3d10_gfx_show_mouse, + win32_show_cursor, NULL, /* grab_mouse_toggle */ d3d10_gfx_get_current_shader, NULL, /* get_current_software_framebuffer */ diff --git a/gfx/drivers/d3d11.c b/gfx/drivers/d3d11.c index ca1ef8b159..00ea1a566b 100644 --- a/gfx/drivers/d3d11.c +++ b/gfx/drivers/d3d11.c @@ -230,7 +230,7 @@ static void d3d11_overlay_enable(void* data, bool state) return; d3d11->overlays.enabled = state; - win32_show_cursor(state); + win32_show_cursor(d3d11, state); } static void d3d11_overlay_full_screen(void* data, bool enable) @@ -1726,8 +1726,6 @@ static void d3d11_gfx_set_osd_msg( } } -static void d3d11_gfx_show_mouse(void* data, bool state) { win32_show_cursor(state); } - static uintptr_t d3d11_gfx_load_texture( void* video_data, void* data, bool threaded, enum texture_filter_type filter_type) { @@ -1826,7 +1824,7 @@ static const video_poke_interface_t d3d11_poke_interface = { d3d11_set_menu_texture_frame, d3d11_set_menu_texture_enable, d3d11_gfx_set_osd_msg, - d3d11_gfx_show_mouse, + win32_show_cursor, NULL, /* grab_mouse_toggle */ d3d11_gfx_get_current_shader, NULL, /* get_current_software_framebuffer */ diff --git a/gfx/drivers/d3d12.c b/gfx/drivers/d3d12.c index 200c79a7e8..0e6a9b2aae 100644 --- a/gfx/drivers/d3d12.c +++ b/gfx/drivers/d3d12.c @@ -200,7 +200,7 @@ static void d3d12_overlay_enable(void* data, bool state) return; d3d12->overlays.enabled = state; - win32_show_cursor(state); + win32_show_cursor(d3d12, state); } static void d3d12_overlay_full_screen(void* data, bool enable) @@ -1702,11 +1702,6 @@ static void d3d12_set_menu_texture_enable(void* data, d3d12->menu.fullscreen = full_screen; } -static void d3d12_gfx_show_mouse(void* data, bool state) -{ - win32_show_cursor(state); -} - static void d3d12_gfx_set_aspect_ratio(void* data, unsigned aspect_ratio_idx) { d3d12_video_t* d3d12 = (d3d12_video_t*)data; @@ -1830,7 +1825,7 @@ static const video_poke_interface_t d3d12_poke_interface = { d3d12_set_menu_texture_frame, d3d12_set_menu_texture_enable, d3d12_gfx_set_osd_msg, - d3d12_gfx_show_mouse, + win32_show_cursor, NULL, /* grab_mouse_toggle */ d3d12_gfx_get_current_shader, NULL, /* get_current_software_framebuffer */ diff --git a/gfx/drivers/d3d8.c b/gfx/drivers/d3d8.c index 85ade46788..b15a1403db 100644 --- a/gfx/drivers/d3d8.c +++ b/gfx/drivers/d3d8.c @@ -1208,13 +1208,6 @@ static void d3d8_set_rotation(void *data, unsigned rot) d3d->should_resize = true; } -static void d3d8_show_mouse(void *data, bool state) -{ -#ifndef _XBOX - win32_show_cursor(state); -#endif -} - static void *d3d8_init(const video_info_t *info, input_driver_t **input, void **input_data) { @@ -1422,7 +1415,9 @@ static void d3d8_overlay_enable(void *data, bool state) for (i = 0; i < d3d->overlays_size; i++) d3d->overlays_enabled = state; - d3d8_show_mouse(d3d, state); +#ifndef _XBOX + win32_show_cursor(d3d, state); +#endif } static void d3d8_overlay_full_screen(void *data, bool enable) @@ -1781,7 +1776,7 @@ static void d3d8_set_video_mode(void *data, bool fullscreen) { #ifndef _XBOX - win32_show_cursor(!fullscreen); + win32_show_cursor(data, !fullscreen); #endif } @@ -1818,7 +1813,7 @@ static const video_poke_interface_t d3d_poke_interface = { d3d8_set_menu_texture_enable, d3d8_set_osd_msg, - d3d8_show_mouse, + win32_show_cursor, NULL, /* grab_mouse_toggle */ NULL, /* get_current_shader */ NULL, /* get_current_software_framebuffer */ diff --git a/gfx/drivers/d3d9.c b/gfx/drivers/d3d9.c index c29c8c53a1..f64ce3c4a0 100644 --- a/gfx/drivers/d3d9.c +++ b/gfx/drivers/d3d9.c @@ -1265,13 +1265,6 @@ static void d3d9_set_rotation(void *data, unsigned rot) d3d->dev_rotation = rot; } -static void d3d9_show_mouse(void *data, bool state) -{ -#ifndef XBOX - win32_show_cursor(state); -#endif -} - static void *d3d9_init(const video_info_t *info, input_driver_t **input, void **input_data) { @@ -1475,7 +1468,9 @@ static void d3d9_overlay_enable(void *data, bool state) for (i = 0; i < d3d->overlays_size; i++) d3d->overlays_enabled = state; - d3d9_show_mouse(d3d, state); +#ifndef XBOX + win32_show_cursor(d3d, state); +#endif } static void d3d9_overlay_full_screen(void *data, bool enable) @@ -1959,7 +1954,7 @@ static void d3d9_set_video_mode(void *data, bool fullscreen) { #ifndef _XBOX - win32_show_cursor(!fullscreen); + win32_show_cursor(data, !fullscreen); #endif } @@ -2001,7 +1996,7 @@ static const video_poke_interface_t d3d9_poke_interface = { d3d9_set_menu_texture_enable, d3d9_set_osd_msg, - d3d9_show_mouse, + win32_show_cursor, NULL, /* grab_mouse_toggle */ NULL, /* get_current_shader */ NULL, /* get_current_software_framebuffer */ diff --git a/gfx/drivers_context/gdi_ctx.c b/gfx/drivers_context/gdi_ctx.c index f7d293fdab..de98135698 100644 --- a/gfx/drivers_context/gdi_ctx.c +++ b/gfx/drivers_context/gdi_ctx.c @@ -233,12 +233,6 @@ static bool gfx_ctx_gdi_bind_api(void *data, return true; } -static void gfx_ctx_gdi_show_mouse(void *data, bool state) -{ - (void)data; - win32_show_cursor(state); -} - static void gfx_ctx_gdi_swap_interval(void *data, int interval) { (void)data; @@ -299,7 +293,7 @@ const gfx_ctx_driver_t gfx_ctx_gdi = { NULL, NULL, NULL, - gfx_ctx_gdi_show_mouse, + win32_show_cursor, "gdi", gfx_ctx_gdi_get_flags, gfx_ctx_gdi_set_flags, diff --git a/gfx/drivers_context/uwp_egl_ctx.c b/gfx/drivers_context/uwp_egl_ctx.c index 75e8da088f..d080351d3f 100644 --- a/gfx/drivers_context/uwp_egl_ctx.c +++ b/gfx/drivers_context/uwp_egl_ctx.c @@ -275,12 +275,6 @@ static bool gfx_ctx_uwp_has_focus(void *data) return win32_has_focus(); } -static void gfx_ctx_uwp_show_mouse(void* data, bool state) -{ - (void)data; - win32_show_cursor(state); -} - static enum gfx_ctx_api gfx_ctx_uwp_get_api(void *data) { return uwp_api; @@ -359,7 +353,7 @@ const gfx_ctx_driver_t gfx_ctx_uwp = { gfx_ctx_uwp_get_proc_address, NULL, NULL, - gfx_ctx_uwp_show_mouse, + win32_show_cursor, "uwp", gfx_ctx_uwp_get_flags, /* get flags */ NULL, /* set flags */ diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index 66063576ad..12c15e4fba 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -862,12 +862,6 @@ static bool gfx_ctx_wgl_bind_api(void *data, return false; } -static void gfx_ctx_wgl_show_mouse(void *data, bool state) -{ - (void)data; - win32_show_cursor(state); -} - static void gfx_ctx_wgl_bind_hw_render(void *data, bool enable) { switch (win32_api) @@ -1015,7 +1009,7 @@ const gfx_ctx_driver_t gfx_ctx_wgl = { gfx_ctx_wgl_get_proc_address, NULL, NULL, - gfx_ctx_wgl_show_mouse, + win32_show_cursor, "wgl", gfx_ctx_wgl_get_flags, gfx_ctx_wgl_set_flags, diff --git a/uwp/uwp_main.cpp b/uwp/uwp_main.cpp index 120e8757b7..91ee000ac0 100644 --- a/uwp/uwp_main.cpp +++ b/uwp/uwp_main.cpp @@ -603,10 +603,10 @@ extern "C" { return true; } - void win32_show_cursor(bool state) - { - CoreWindow::GetForCurrentThread()->PointerCursor = state ? ref new CoreCursor(CoreCursorType::Arrow, 0) : nullptr; - } + void win32_show_cursor(void *data, bool state) + { + CoreWindow::GetForCurrentThread()->PointerCursor = state ? ref new CoreCursor(CoreCursorType::Arrow, 0) : nullptr; + } bool win32_get_metrics(void* data,