diff --git a/gfx/d3d/d3d.cpp b/gfx/d3d/d3d.cpp index 27dd1d1656..69ea08e32b 100644 --- a/gfx/d3d/d3d.cpp +++ b/gfx/d3d/d3d.cpp @@ -868,8 +868,14 @@ static bool d3d_alive(void *data) if (resize) { + gfx_ctx_mode_t mode; + d3d->should_resize = true; - gfx_ctx_set_resize(temp_width, temp_height); + + mode.width = temp_width; + mode.height = temp_height; + + gfx_ctx_ctl(GFX_CTL_SET_RESIZE, &mode); d3d_restore(d3d); } diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 7972d80494..d7e1d6ada5 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -1706,9 +1706,14 @@ static bool gl_frame(void *data, const void *frame, if (gl->should_resize) { + gfx_ctx_mode_t mode; + gl->should_resize = false; - gfx_ctx_set_resize(width, height); + mode.width = width; + mode.height = height; + + gfx_ctx_ctl(GFX_CTL_SET_RESIZE, &mode); #ifdef HAVE_FBO if (gl->fbo_inited) diff --git a/gfx/video_context_driver.c b/gfx/video_context_driver.c index cab736ee23..62c9166d0a 100644 --- a/gfx/video_context_driver.c +++ b/gfx/video_context_driver.c @@ -90,15 +90,6 @@ void gfx_ctx_get_video_size(unsigned *width, unsigned *height) current_video_context->get_video_size(video_context_data, width, height); } -bool gfx_ctx_set_resize(unsigned width, unsigned height) -{ - if (!current_video_context) - return false; - - return current_video_context->set_resize( - video_context_data, width, height); -} - /** * find_gfx_ctx_driver_index: * @ident : Identifier of resampler driver to find. @@ -432,6 +423,14 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data) mode_info->height, mode_info->fullscreen); } break; + case GFX_CTL_SET_RESIZE: + { + gfx_ctx_mode_t *mode_info = (gfx_ctx_mode_t*)data; + if (!current_video_context) + return false; + return current_video_context->set_resize( + video_context_data, mode_info->width, mode_info->height); + } case GFX_CTL_NONE: default: break; diff --git a/gfx/video_context_driver.h b/gfx/video_context_driver.h index 036d4d7e31..c6606d6cee 100644 --- a/gfx/video_context_driver.h +++ b/gfx/video_context_driver.h @@ -80,7 +80,8 @@ enum gfx_ctx_ctl_state GFX_CTL_INPUT_DRIVER, GFX_CTL_SUPPRESS_SCREENSAVER, GFX_CTL_IDENT_GET, - GFX_CTL_SET_VIDEO_MODE + GFX_CTL_SET_VIDEO_MODE, + GFX_CTL_SET_RESIZE }; typedef void (*gfx_ctx_proc_t)(void); @@ -274,8 +275,6 @@ const gfx_ctx_driver_t *gfx_ctx_init_first(void *data, const char *ident, void gfx_ctx_get_video_size(unsigned *width, unsigned *height); -bool gfx_ctx_set_resize(unsigned width, unsigned height); - bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data); #ifdef __cplusplus