diff --git a/gfx/common/win32_common.c b/gfx/common/win32_common.c index 60452928a8..b4d8469c11 100644 --- a/gfx/common/win32_common.c +++ b/gfx/common/win32_common.c @@ -1450,7 +1450,8 @@ void win32_show_cursor(void *data, bool state) #endif } -void win32_check_window(bool *quit, bool *resize, +void win32_check_window(void *data, + bool *quit, bool *resize, unsigned *width, unsigned *height) { #if !defined(_XBOX) diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index 1968214a50..d8b7fc43b8 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -98,7 +98,8 @@ HWND win32_get_window(void); bool win32_has_focus(void *data); -void win32_check_window(bool *quit, +void win32_check_window(void *data, + bool *quit, bool *resize, unsigned *width, unsigned *height); void win32_set_window(unsigned *width, unsigned *height, diff --git a/gfx/drivers/d3d10.c b/gfx/drivers/d3d10.c index 737612ff6c..7279135a3e 100644 --- a/gfx/drivers/d3d10.c +++ b/gfx/drivers/d3d10.c @@ -1552,7 +1552,9 @@ static bool d3d10_gfx_alive(void* data) bool quit; d3d10_video_t* d3d10 = (d3d10_video_t*)data; - win32_check_window(&quit, &d3d10->resize_chain, &d3d10->vp.full_width, &d3d10->vp.full_height); + win32_check_window(NULL, + &quit, &d3d10->resize_chain, &d3d10->vp.full_width, + &d3d10->vp.full_height); if ( d3d10->resize_chain && d3d10->vp.full_width != 0 diff --git a/gfx/drivers/d3d11.c b/gfx/drivers/d3d11.c index 2183286f6b..84e1381dd7 100644 --- a/gfx/drivers/d3d11.c +++ b/gfx/drivers/d3d11.c @@ -1626,9 +1626,15 @@ static bool d3d11_gfx_alive(void* data) bool quit; d3d11_video_t* d3d11 = (d3d11_video_t*)data; - win32_check_window(&quit, &d3d11->resize_chain, &d3d11->vp.full_width, &d3d11->vp.full_height); + win32_check_window(NULL, + &quit, + &d3d11->resize_chain, + &d3d11->vp.full_width, + &d3d11->vp.full_height); - if (d3d11->resize_chain && d3d11->vp.full_width != 0 && d3d11->vp.full_height != 0) + if ( d3d11->resize_chain + && d3d11->vp.full_width != 0 + && d3d11->vp.full_height != 0) video_driver_set_size(d3d11->vp.full_width, d3d11->vp.full_height); return !quit; diff --git a/gfx/drivers/d3d12.c b/gfx/drivers/d3d12.c index 9628a79b9a..5a4989ff7b 100644 --- a/gfx/drivers/d3d12.c +++ b/gfx/drivers/d3d12.c @@ -1619,7 +1619,11 @@ static bool d3d12_gfx_alive(void* data) bool quit; d3d12_video_t* d3d12 = (d3d12_video_t*)data; - win32_check_window(&quit, &d3d12->resize_chain, &d3d12->vp.full_width, &d3d12->vp.full_height); + win32_check_window(NULL, + &quit, + &d3d12->resize_chain, + &d3d12->vp.full_width, + &d3d12->vp.full_height); if ( d3d12->resize_chain && d3d12->vp.full_width != 0 diff --git a/gfx/drivers/d3d8.c b/gfx/drivers/d3d8.c index 1e3ca02e73..f384539215 100644 --- a/gfx/drivers/d3d8.c +++ b/gfx/drivers/d3d8.c @@ -1046,9 +1046,7 @@ static bool d3d8_alive(void *data) /* Needed because some context drivers don't track their sizes */ video_driver_get_size(&temp_width, &temp_height); -#ifndef _XBOX - win32_check_window(&quit, &resize, &temp_width, &temp_height); -#endif + win32_check_window(NULL, &quit, &resize, &temp_width, &temp_height); if (quit) d3d->quitting = quit; diff --git a/gfx/drivers/d3d9.c b/gfx/drivers/d3d9.c index 50117403ac..27da553843 100644 --- a/gfx/drivers/d3d9.c +++ b/gfx/drivers/d3d9.c @@ -1057,9 +1057,7 @@ static bool d3d9_alive(void *data) /* Needed because some context drivers don't track their sizes */ video_driver_get_size(&temp_width, &temp_height); -#ifndef _XBOX - win32_check_window(&quit, &resize, &temp_width, &temp_height); -#endif + win32_check_window(NULL, &quit, &resize, &temp_width, &temp_height); if (quit) d3d->quitting = quit; diff --git a/gfx/drivers/gdi_gfx.c b/gfx/drivers/gdi_gfx.c index 2d735b6630..d7d5e13afb 100644 --- a/gfx/drivers/gdi_gfx.c +++ b/gfx/drivers/gdi_gfx.c @@ -493,7 +493,7 @@ static bool gdi_gfx_alive(void *data) /* Needed because some context drivers don't track their sizes */ video_driver_get_size(&temp_width, &temp_height); - win32_check_window( + win32_check_window(NULL, &quit, &resize, &temp_width, &temp_height); ret = !quit; diff --git a/gfx/drivers_context/uwp_egl_ctx.c b/gfx/drivers_context/uwp_egl_ctx.c index df27198e24..3d0eb0ad5a 100644 --- a/gfx/drivers_context/uwp_egl_ctx.c +++ b/gfx/drivers_context/uwp_egl_ctx.c @@ -124,12 +124,6 @@ static void gfx_ctx_uwp_swap_interval(void *data, int interval) } } -static void gfx_ctx_uwp_check_window(void *data, bool *quit, - bool *resize, unsigned *width, unsigned *height) -{ - win32_check_window(quit, resize, width, height); -} - static gfx_ctx_proc_t gfx_ctx_uwp_get_proc_address(const char* symbol) { #ifdef HAVE_DYNAMIC @@ -150,7 +144,7 @@ static void gfx_ctx_uwp_get_video_size(void *data, { bool quit; bool resize; - win32_check_window(&quit, &resize, width, height); + win32_check_window(NULL, &quit, &resize, width, height); } static void *gfx_ctx_uwp_init(void *video_driver) @@ -275,7 +269,7 @@ const gfx_ctx_driver_t gfx_ctx_uwp = { win32_get_metrics, NULL, NULL, /* update title */ - gfx_ctx_uwp_check_window, + win32_check_window, gfx_ctx_uwp_set_resize, win32_has_focus, NULL, /* suppress screensaver */ diff --git a/gfx/drivers_context/w_vk_ctx.c b/gfx/drivers_context/w_vk_ctx.c index d9bfc98e49..ea0901701a 100644 --- a/gfx/drivers_context/w_vk_ctx.c +++ b/gfx/drivers_context/w_vk_ctx.c @@ -93,7 +93,7 @@ static void gfx_ctx_w_vk_swap_interval(void *data, int interval) static void gfx_ctx_w_vk_check_window(void *data, bool *quit, bool *resize, unsigned *width, unsigned *height) { - win32_check_window(quit, resize, width, height); + win32_check_window(NULL, quit, resize, width, height); if (win32_vk.need_new_swapchain) *resize = true; diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index d0a1912ea2..fa3f85c57f 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -474,12 +474,6 @@ static void gfx_ctx_wgl_swap_interval(void *data, int interval) } } -static void gfx_ctx_wgl_check_window(void *data, bool *quit, - bool *resize, unsigned *width, unsigned *height) -{ - win32_check_window(quit, resize, width, height); -} - static void gfx_ctx_wgl_swap_buffers(void *data) { (void)data; @@ -866,7 +860,7 @@ const gfx_ctx_driver_t gfx_ctx_wgl = { win32_get_metrics, NULL, gfx_ctx_wgl_update_title, - gfx_ctx_wgl_check_window, + win32_check_window, gfx_ctx_wgl_set_resize, win32_has_focus, win32_suppress_screensaver, diff --git a/uwp/uwp_main.cpp b/uwp/uwp_main.cpp index 52f6c11fb3..c5a3bbdf56 100644 --- a/uwp/uwp_main.cpp +++ b/uwp/uwp_main.cpp @@ -660,7 +660,8 @@ extern "C" { return false; } - void win32_check_window(bool *quit, bool *resize, unsigned *width, unsigned *height) + void win32_check_window(void *data, + bool *quit, bool *resize, unsigned *width, unsigned *height) { *quit = App::GetInstance()->IsWindowClosed(); *resize = App::GetInstance()->CheckWindowResized();