Remove video_context_driver_check_window

This commit is contained in:
twinaphex 2018-10-14 17:49:10 +02:00
parent d58dc3186d
commit 2edd03361c
6 changed files with 22 additions and 54 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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