Simplify win32_check_window

This commit is contained in:
twinaphex 2020-07-18 17:09:07 +02:00
parent 04a0c55add
commit 7c66f0adbc
12 changed files with 29 additions and 30 deletions

View file

@ -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)

View file

@ -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,

View file

@ -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

View file

@ -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;

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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 */

View file

@ -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;

View file

@ -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,

View file

@ -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();