diff --git a/gfx/drivers/gdi_gfx.c b/gfx/drivers/gdi_gfx.c index 8765351ca4..9caa715d27 100644 --- a/gfx/drivers/gdi_gfx.c +++ b/gfx/drivers/gdi_gfx.c @@ -30,6 +30,7 @@ #include "../../driver.h" #include "../../configuration.h" +#include "../../retroarch.h" #include "../../verbosity.h" #include "../../frontend/frontend_driver.h" #include "../common/gdi_common.h" @@ -360,23 +361,21 @@ static void gdi_gfx_set_nonblock_state(void *data, bool toggle) static bool gdi_gfx_alive(void *data) { - gfx_ctx_size_t size_data; unsigned temp_width = 0; unsigned temp_height = 0; bool quit = false; bool resize = false; bool ret = false; + bool is_shutdown = rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL); + gdi_t *gdi = (gdi_t*)data; /* Needed because some context drivers don't track their sizes */ video_driver_get_size(&temp_width, &temp_height); - size_data.quit = &quit; - size_data.resize = &resize; - size_data.width = &temp_width; - size_data.height = &temp_height; + gdi->ctx_driver->check_window(gdi->ctx_data, + &quit, &resize, &temp_width, &temp_height, is_shutdown); - if (video_context_driver_check_window(&size_data)) - ret = !quit; + ret = !quit; if (temp_width != 0 && temp_height != 0) video_driver_set_size(&temp_width, &temp_height); @@ -406,7 +405,7 @@ static bool gdi_gfx_has_windowed(void *data) static void gdi_gfx_free(void *data) { gdi_t *gdi = (gdi_t*)data; - HWND hwnd = win32_get_window(); + HWND hwnd = win32_get_window(); if (gdi_menu_frame) { diff --git a/gfx/drivers/sixel_gfx.c b/gfx/drivers/sixel_gfx.c index 6966820e14..8daecdaa32 100644 --- a/gfx/drivers/sixel_gfx.c +++ b/gfx/drivers/sixel_gfx.c @@ -439,16 +439,14 @@ static bool sixel_gfx_alive(void *data) unsigned temp_height = 0; bool quit = false; bool resize = false; + bool is_shutdown = rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL); + sixel_t *sixel = (sixel_t*)data; /* Needed because some context drivers don't track their sizes */ video_driver_get_size(&temp_width, &temp_height); - size_data.quit = &quit; - size_data.resize = &resize; - size_data.width = &temp_width; - size_data.height = &temp_height; - - video_context_driver_check_window(&size_data); + sixel->ctx_driver->check_window(sixel->ctx_data, + &quit, &resize, &temp_width, &temp_height, is_shutdown); if (temp_width != 0 && temp_height != 0) video_driver_set_size(&temp_width, &temp_height); diff --git a/gfx/drivers/vg.c b/gfx/drivers/vg.c index b93ce38fb2..28db6bdde7 100644 --- a/gfx/drivers/vg.c +++ b/gfx/drivers/vg.c @@ -441,18 +441,14 @@ static bool vg_frame(void *data, const void *frame, static bool vg_alive(void *data) { - gfx_ctx_size_t size_data; bool quit = false; unsigned temp_width = 0; unsigned temp_height = 0; vg_t *vg = (vg_t*)data; + bool is_shutdown = rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL); - size_data.quit = &quit; - size_data.resize = &vg->should_resize; - size_data.width = &temp_width; - size_data.height = &temp_height; - - video_context_driver_check_window(&size_data); + vg->ctx_driver->check_window(vg->ctx_data, + &quit, &resize, &temp_width, &temp_height, is_shutdown); if (temp_width != 0 && temp_height != 0) video_driver_set_size(&temp_width, &temp_height); diff --git a/gfx/drivers/vulkan.c b/gfx/drivers/vulkan.c index 6713a46fbc..859b37a2b6 100644 --- a/gfx/drivers/vulkan.c +++ b/gfx/drivers/vulkan.c @@ -1286,30 +1286,25 @@ static void vulkan_set_nonblock_state(void *data, bool state) static bool vulkan_alive(void *data) { - gfx_ctx_size_t size_data; unsigned temp_width = 0; unsigned temp_height = 0; bool ret = false; bool quit = false; bool resize = false; vk_t *vk = (vk_t*)data; + bool is_shutdown = rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL); video_driver_get_size(&temp_width, &temp_height); - size_data.quit = &quit; - size_data.resize = &resize; - size_data.width = &temp_width; - size_data.height = &temp_height; + vk->ctx_driver->check_window(vk->ctx_data, + &quit, &resize, &temp_width, &temp_height, is_shutdown); - if (video_context_driver_check_window(&size_data)) - { - if (quit) - vk->quitting = true; - else if (resize) - vk->should_resize = true; + if (quit) + vk->quitting = true; + else if (resize) + vk->should_resize = true; - ret = !vk->quitting; - } + ret = !vk->quitting; if (temp_width != 0 && temp_height != 0) video_driver_set_size(&temp_width, &temp_height); diff --git a/gfx/video_driver.c b/gfx/video_driver.c index c9aa356823..e2233a4323 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -3082,24 +3082,6 @@ const gfx_ctx_driver_t *video_context_driver_init_first(void *data, return NULL; } -bool video_context_driver_check_window(gfx_ctx_size_t *size_data) -{ - if ( video_context_data - && current_video_context.check_window) - { - bool is_shutdown = rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL); - current_video_context.check_window(video_context_data, - size_data->quit, - size_data->resize, - size_data->width, - size_data->height, - is_shutdown); - return true; - } - - return false; -} - bool video_context_driver_init_image_buffer(const video_info_t *data) { if ( diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 6add41cec4..013df5745a 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -1145,8 +1145,6 @@ const gfx_ctx_driver_t *video_context_driver_init_first( enum gfx_ctx_api api, unsigned major, unsigned minor, bool hw_render_ctx, void **ctx_data); -bool video_context_driver_check_window(gfx_ctx_size_t *size_data); - bool video_context_driver_find_prev_driver(void); bool video_context_driver_find_next_driver(void);