diff --git a/gfx/drivers/d3d.cpp b/gfx/drivers/d3d.cpp index e2a39d1bb8..72a3dbf37e 100644 --- a/gfx/drivers/d3d.cpp +++ b/gfx/drivers/d3d.cpp @@ -886,14 +886,8 @@ static bool d3d_alive(void *data) if (resize) { - gfx_ctx_mode_t mode; - d3d->should_resize = true; - - mode.width = temp_width; - mode.height = temp_height; - - current_video_context.set_resize(video_context_data, mode.width, mode.height); + video_driver_set_resize(temp_width, temp_height); d3d_restore(d3d); } diff --git a/gfx/video_driver.c b/gfx/video_driver.c index aa2cddb153..2360911347 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -411,6 +411,12 @@ static bool set_resize_null(void *a, unsigned b, unsigned c) return false; } +void video_driver_set_resize(unsigned width, unsigned height) +{ + if (current_video_context.set_resize) + current_video_context.set_resize(video_context_data, width, height); +} + /** * video_driver_find_handle: * @idx : index of driver to get handle to. diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 2109b44cb0..fe9ccb1c13 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -1066,6 +1066,8 @@ void video_driver_set_threaded(bool val); void video_driver_get_status(uint64_t *frame_count, bool * is_alive, bool *is_focused); +void video_driver_set_resize(unsigned width, unsigned height); + extern video_driver_t video_gl; extern video_driver_t video_vulkan; extern video_driver_t video_psp1;