diff --git a/gfx/drivers/d3d.cpp b/gfx/drivers/d3d.cpp index 43f1f429b8..1ada4f5dd4 100644 --- a/gfx/drivers/d3d.cpp +++ b/gfx/drivers/d3d.cpp @@ -881,7 +881,7 @@ static bool d3d_alive(void *data) mode.width = temp_width; mode.height = temp_height; - video_context_driver_set_resize(&mode); + video_context_driver_set_resize(mode); d3d_restore(d3d); } diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 7cab60b1e3..55a89ff0a8 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -1143,7 +1143,7 @@ static bool gl_frame(void *data, const void *frame, mode.width = width; mode.height = height; - video_context_driver_set_resize(&mode); + video_context_driver_set_resize(mode); #ifdef HAVE_FBO if (gl->fbo_inited) diff --git a/gfx/drivers/vulkan.c b/gfx/drivers/vulkan.c index dcdd4429fa..5be806a7c9 100644 --- a/gfx/drivers/vulkan.c +++ b/gfx/drivers/vulkan.c @@ -1921,7 +1921,7 @@ static bool vulkan_frame(void *data, const void *frame, gfx_ctx_mode_t mode; mode.width = width; mode.height = height; - video_context_driver_set_resize(&mode); + video_context_driver_set_resize(mode); vk->should_resize = false; } diff --git a/gfx/drivers_context/cgl_ctx.c b/gfx/drivers_context/cgl_ctx.c index a7bc1bc2a8..68229bc89a 100644 --- a/gfx/drivers_context/cgl_ctx.c +++ b/gfx/drivers_context/cgl_ctx.c @@ -100,14 +100,6 @@ static void gfx_ctx_cgl_swap_buffers(void *data, video_frame_info_t *video_info) CGLFlushDrawable(cgl->glCtx); } -static bool gfx_ctx_cgl_set_resize(void *data, unsigned width, unsigned height) -{ - (void)data; - (void)width; - (void)height; - return false; -} - static bool gfx_ctx_cgl_set_video_mode(void *data, video_frame_info_t *video_info, unsigned width, unsigned height, @@ -344,7 +336,7 @@ const gfx_ctx_driver_t gfx_ctx_cgl = { NULL, NULL, /* update_title */ gfx_ctx_cgl_check_window, - gfx_ctx_cgl_set_resize, + NULL, /* set_resize */ gfx_ctx_cgl_has_focus, gfx_ctx_cgl_suppress_screensaver, NULL, /* has_windowed */ diff --git a/gfx/drivers_context/cocoa_gl_ctx.m b/gfx/drivers_context/cocoa_gl_ctx.m index aa91c64738..e3a49f8ab3 100644 --- a/gfx/drivers_context/cocoa_gl_ctx.m +++ b/gfx/drivers_context/cocoa_gl_ctx.m @@ -574,14 +574,6 @@ static void cocoagl_gfx_ctx_check_window(void *data, bool *quit, } } -static bool cocoagl_gfx_ctx_set_resize(void *data, unsigned width, unsigned height) -{ - (void)data; - (void)width; - (void)height; - return false; -} - static void cocoagl_gfx_ctx_input_driver(void *data, const char *name, const input_driver_t **input, void **input_data) @@ -631,7 +623,7 @@ const gfx_ctx_driver_t gfx_ctx_cocoagl = { NULL, /* update_title */ #endif cocoagl_gfx_ctx_check_window, - cocoagl_gfx_ctx_set_resize, + NULL, /* set_resize */ cocoagl_gfx_ctx_has_focus, cocoagl_gfx_ctx_suppress_screensaver, #if defined(HAVE_COCOATOUCH) diff --git a/gfx/drivers_context/drm_ctx.c b/gfx/drivers_context/drm_ctx.c index f0bb839ab8..4c68edc575 100644 --- a/gfx/drivers_context/drm_ctx.c +++ b/gfx/drivers_context/drm_ctx.c @@ -258,16 +258,6 @@ static void gfx_ctx_drm_swap_buffers(void *data, video_frame_info_t *video_info) gfx_ctx_drm_wait_flip(true); } -static bool gfx_ctx_drm_set_resize(void *data, - unsigned width, unsigned height) -{ - (void)data; - (void)width; - (void)height; - - return false; -} - static void gfx_ctx_drm_get_video_size(void *data, unsigned *width, unsigned *height) { @@ -869,7 +859,7 @@ const gfx_ctx_driver_t gfx_ctx_drm = { NULL, NULL, /* update_window_title */ gfx_ctx_drm_check_window, - gfx_ctx_drm_set_resize, + NULL, /* set_resize */ gfx_ctx_drm_has_focus, gfx_ctx_drm_suppress_screensaver, NULL, /* has_windowed */ diff --git a/gfx/drivers_context/emscriptenegl_ctx.c b/gfx/drivers_context/emscriptenegl_ctx.c index 5266cf4493..cb8e45e93d 100644 --- a/gfx/drivers_context/emscriptenegl_ctx.c +++ b/gfx/drivers_context/emscriptenegl_ctx.c @@ -80,15 +80,6 @@ static void gfx_ctx_emscripten_swap_buffers(void *data, video_frame_info_t *vide /* no-op in emscripten, no way to force swap/wait for VSync in browsers */ } -static bool gfx_ctx_emscripten_set_resize(void *data, - unsigned width, unsigned height) -{ - (void)data; - (void)width; - (void)height; - return false; -} - static void gfx_ctx_emscripten_get_video_size(void *data, unsigned *width, unsigned *height) { @@ -318,7 +309,7 @@ const gfx_ctx_driver_t gfx_ctx_emscripten = { gfx_ctx_emscripten_translate_aspect, NULL, /* update_title */ gfx_ctx_emscripten_check_window, - gfx_ctx_emscripten_set_resize, + NULL, /* set_resize */ gfx_ctx_emscripten_has_focus, gfx_ctx_emscripten_suppress_screensaver, gfx_ctx_emscripten_has_windowed, diff --git a/gfx/drivers_context/gfx_null_ctx.c b/gfx/drivers_context/gfx_null_ctx.c index 448289f1ef..18c81a60df 100644 --- a/gfx/drivers_context/gfx_null_ctx.c +++ b/gfx/drivers_context/gfx_null_ctx.c @@ -39,14 +39,6 @@ static void gfx_ctx_null_swap_buffers(void *data, video_frame_info_t *video_info (void)data; } -static bool gfx_ctx_null_set_resize(void *data, unsigned width, unsigned height) -{ - (void)data; - (void)width; - (void)height; - return false; -} - static void gfx_ctx_null_get_video_size(void *data, unsigned *width, unsigned *height) { (void)data; @@ -150,7 +142,7 @@ const gfx_ctx_driver_t gfx_ctx_null = { NULL, NULL, /* update_title */ gfx_ctx_null_check_window, - gfx_ctx_null_set_resize, + NULL, /* set_resize */ gfx_ctx_null_has_focus, gfx_ctx_null_suppress_screensaver, NULL, /* has_windowed */ diff --git a/gfx/drivers_context/mali_fbdev_ctx.c b/gfx/drivers_context/mali_fbdev_ctx.c index 842f970fa7..cb1561ee9d 100644 --- a/gfx/drivers_context/mali_fbdev_ctx.c +++ b/gfx/drivers_context/mali_fbdev_ctx.c @@ -147,15 +147,6 @@ static void gfx_ctx_mali_fbdev_check_window(void *data, bool *quit, *quit = (bool)frontend_driver_get_signal_handler_state(); } -static bool gfx_ctx_mali_fbdev_set_resize(void *data, - unsigned width, unsigned height) -{ - (void)data; - (void)width; - (void)height; - return false; -} - static bool gfx_ctx_mali_fbdev_set_video_mode(void *data, video_frame_info_t *video_info, unsigned width, unsigned height, @@ -300,7 +291,7 @@ const gfx_ctx_driver_t gfx_ctx_mali_fbdev = { NULL, NULL, /* update_title */ gfx_ctx_mali_fbdev_check_window, - gfx_ctx_mali_fbdev_set_resize, + NULL, /* set_resize */ gfx_ctx_mali_fbdev_has_focus, gfx_ctx_mali_fbdev_suppress_screensaver, NULL, /* has_windowed */ diff --git a/gfx/drivers_context/opendingux_fbdev_ctx.c b/gfx/drivers_context/opendingux_fbdev_ctx.c index f6672ef937..411221e5b4 100644 --- a/gfx/drivers_context/opendingux_fbdev_ctx.c +++ b/gfx/drivers_context/opendingux_fbdev_ctx.c @@ -131,15 +131,6 @@ static void gfx_ctx_opendingux_check_window(void *data, bool *quit, *quit = (bool)frontend_driver_get_signal_handler_state(); } -static bool gfx_ctx_opendingux_set_resize(void *data, - unsigned width, unsigned height) -{ - (void)data; - (void)width; - (void)height; - return false; -} - static bool gfx_ctx_opendingux_set_video_mode(void *data, video_frame_info_t *video_info, unsigned width, unsigned height, @@ -274,7 +265,7 @@ const gfx_ctx_driver_t gfx_ctx_opendingux_fbdev = { NULL, NULL, /* update_title */ gfx_ctx_opendingux_check_window, - gfx_ctx_opendingux_set_resize, + NULL, /* set_resize */ gfx_ctx_opendingux_has_focus, gfx_ctx_opendingux_suppress_screensaver, NULL, /* has_windowed */ diff --git a/gfx/drivers_context/osmesa_ctx.c b/gfx/drivers_context/osmesa_ctx.c index 65fd769055..da8009229e 100644 --- a/gfx/drivers_context/osmesa_ctx.c +++ b/gfx/drivers_context/osmesa_ctx.c @@ -317,14 +317,6 @@ static void osmesa_ctx_check_window(void *data, bool *quit, *quit = false; } -static bool osmesa_ctx_set_resize(void *data, unsigned width, unsigned height) -{ - (void)data; - (void)width; - (void)height; - return false; -} - static bool osmesa_ctx_has_focus(void *data) { (void)data; @@ -402,7 +394,7 @@ const gfx_ctx_driver_t gfx_ctx_osmesa = NULL, /* translate_aspect */ NULL, /* update_title */ osmesa_ctx_check_window, - osmesa_ctx_set_resize, + NULL, /* set_resize */ osmesa_ctx_has_focus, osmesa_ctx_suppress_screensaver, osmesa_ctx_has_windowed, diff --git a/gfx/drivers_context/ps3_ctx.c b/gfx/drivers_context/ps3_ctx.c index e427fcb2ea..7f35f60daa 100644 --- a/gfx/drivers_context/ps3_ctx.c +++ b/gfx/drivers_context/ps3_ctx.c @@ -186,12 +186,6 @@ static void gfx_ctx_ps3_swap_buffers(void *data, video_frame_info_t *video_info) #endif } -static bool gfx_ctx_ps3_set_resize(void *data, - unsigned width, unsigned height) -{ - return false; -} - static void gfx_ctx_ps3_get_video_size(void *data, unsigned *width, unsigned *height) { @@ -413,7 +407,7 @@ const gfx_ctx_driver_t gfx_ctx_ps3 = { NULL, NULL, /* update_title */ gfx_ctx_ps3_check_window, - gfx_ctx_ps3_set_resize, + NULL, /* set_resize */ gfx_ctx_ps3_has_focus, gfx_ctx_ps3_suppress_screensaver, NULL, /* has_windowed */ diff --git a/gfx/drivers_context/qnx_ctx.c b/gfx/drivers_context/qnx_ctx.c index 4126740754..252f89808d 100644 --- a/gfx/drivers_context/qnx_ctx.c +++ b/gfx/drivers_context/qnx_ctx.c @@ -307,15 +307,6 @@ static void gfx_ctx_qnx_check_window(void *data, bool *quit, *quit = true; } -static bool gfx_ctx_qnx_set_resize(void *data, - unsigned width, unsigned height) -{ - (void)data; - (void)width; - (void)height; - return false; -} - static bool gfx_ctx_qnx_set_video_mode(void *data, video_frame_info_t *video_info, unsigned width, unsigned height, @@ -473,7 +464,7 @@ const gfx_ctx_driver_t gfx_ctx_qnx = { NULL, NULL, /* update_title */ gfx_ctx_qnx_check_window, - gfx_ctx_qnx_set_resize, + NULL, /* set_resize */ gfx_ctx_qnx_has_focus, gfx_ctx_qnx_suppress_screensaver, NULL, /* has_windowed */ diff --git a/gfx/drivers_context/sdl_gl_ctx.c b/gfx/drivers_context/sdl_gl_ctx.c index ad6dbff509..8b1847e44c 100644 --- a/gfx/drivers_context/sdl_gl_ctx.c +++ b/gfx/drivers_context/sdl_gl_ctx.c @@ -339,14 +339,6 @@ static void sdl_ctx_check_window(void *data, bool *quit, bool *resize,unsigned * } } -static bool sdl_ctx_set_resize(void *data, unsigned width, unsigned height) -{ - (void)data; - (void)width; - (void)height; - return false; -} - static bool sdl_ctx_has_focus(void *data) { unsigned flags; @@ -432,7 +424,7 @@ const gfx_ctx_driver_t gfx_ctx_sdl_gl = NULL, /* translate_aspect */ sdl_ctx_update_title, sdl_ctx_check_window, - sdl_ctx_set_resize, + NULL, /* set_resize */ sdl_ctx_has_focus, sdl_ctx_suppress_screensaver, sdl_ctx_has_windowed, diff --git a/gfx/drivers_context/vc_egl_ctx.c b/gfx/drivers_context/vc_egl_ctx.c index 007e26b1c8..c2b98d5ebd 100644 --- a/gfx/drivers_context/vc_egl_ctx.c +++ b/gfx/drivers_context/vc_egl_ctx.c @@ -96,14 +96,6 @@ static void gfx_ctx_vc_check_window(void *data, bool *quit, *quit = (bool)frontend_driver_get_signal_handler_state(); } -static bool gfx_ctx_vc_set_resize(void *data, unsigned width, unsigned height) -{ - (void)data; - (void)width; - (void)height; - return false; -} - static void gfx_ctx_vc_get_video_size(void *data, unsigned *width, unsigned *height) { @@ -641,7 +633,7 @@ const gfx_ctx_driver_t gfx_ctx_videocore = { gfx_ctx_vc_translate_aspect, NULL, /* update_title */ gfx_ctx_vc_check_window, - gfx_ctx_vc_set_resize, + NULL, /* set_resize */ gfx_ctx_vc_has_focus, gfx_ctx_vc_suppress_screensaver, NULL, /* has_windowed */ diff --git a/gfx/drivers_context/vivante_fbdev_ctx.c b/gfx/drivers_context/vivante_fbdev_ctx.c index 7c6f4662c9..c59e5dd577 100644 --- a/gfx/drivers_context/vivante_fbdev_ctx.c +++ b/gfx/drivers_context/vivante_fbdev_ctx.c @@ -135,15 +135,6 @@ static void gfx_ctx_vivante_check_window(void *data, bool *quit, *quit = (bool)frontend_driver_get_signal_handler_state(); } -static bool gfx_ctx_vivante_set_resize(void *data, - unsigned width, unsigned height) -{ - (void)data; - (void)width; - (void)height; - return false; -} - static bool gfx_ctx_vivante_set_video_mode(void *data, video_frame_info_t *video_info, unsigned width, unsigned height, @@ -279,7 +270,7 @@ const gfx_ctx_driver_t gfx_ctx_vivante_fbdev = { NULL, NULL, /* update_title */ gfx_ctx_vivante_check_window, - gfx_ctx_vivante_set_resize, + NULL, /* set_resize */ gfx_ctx_vivante_has_focus, gfx_ctx_vivante_suppress_screensaver, NULL, /* has_windowed */ diff --git a/gfx/drivers_context/xegl_ctx.c b/gfx/drivers_context/xegl_ctx.c index c375a68615..661d5239c0 100644 --- a/gfx/drivers_context/xegl_ctx.c +++ b/gfx/drivers_context/xegl_ctx.c @@ -91,15 +91,6 @@ EGL_BLUE_SIZE, 1, \ EGL_ALPHA_SIZE, 0, \ EGL_DEPTH_SIZE, 0 -static bool gfx_ctx_xegl_set_resize(void *data, - unsigned width, unsigned height) -{ - (void)data; - (void)width; - (void)height; - return false; -} - static void *gfx_ctx_xegl_init(video_frame_info_t video_info, void *video_driver) { #ifdef HAVE_EGL @@ -593,7 +584,7 @@ const gfx_ctx_driver_t gfx_ctx_x_egl = NULL, x11_update_title, x11_check_window, - gfx_ctx_xegl_set_resize, + NULL, /* set_resize */ x11_has_focus, gfx_ctx_xegl_suppress_screensaver, gfx_ctx_xegl_has_windowed, diff --git a/gfx/video_context_driver.c b/gfx/video_context_driver.c index e66066cfe3..a8cc52e78d 100644 --- a/gfx/video_context_driver.c +++ b/gfx/video_context_driver.c @@ -462,16 +462,6 @@ bool video_context_driver_set_video_mode(gfx_ctx_mode_t *mode_info) return true; } -bool video_context_driver_set_resize(gfx_ctx_mode_t *mode_info) -{ - if (!current_video_context) - return false; - if (!current_video_context->set_resize( - video_context_data, mode_info->width, mode_info->height)) - return false; - return true; -} - bool video_context_driver_get_video_size(gfx_ctx_mode_t *mode_info) { if (!current_video_context || !current_video_context->get_video_size) diff --git a/gfx/video_context_driver.h b/gfx/video_context_driver.h index 20f52a1cc7..52baf831d9 100644 --- a/gfx/video_context_driver.h +++ b/gfx/video_context_driver.h @@ -302,6 +302,10 @@ void video_context_driver_destroy(void); #define video_context_driver_focus() ((video_context_data && current_video_context->has_focus && current_video_context->has_focus(video_context_data)) ? true : false) +#define video_context_driver_set_resize(mode_info) \ + if (current_video_context && current_video_context->set_resize) \ + current_video_context->set_resize(video_context_data, mode_info.width, mode_info.height) + bool video_context_driver_get_video_output_size(gfx_ctx_size_t *size_data); bool video_context_driver_swap_interval(unsigned *interval); @@ -314,8 +318,6 @@ bool video_context_driver_get_ident(gfx_ctx_ident_t *ident); bool video_context_driver_set_video_mode(gfx_ctx_mode_t *mode_info); -bool video_context_driver_set_resize(gfx_ctx_mode_t *mode_info); - bool video_context_driver_get_video_size(gfx_ctx_mode_t *mode_info); bool video_context_driver_get_context_data(void *data);