diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index c31ceb319d..f0252df623 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -2106,13 +2106,10 @@ static void gl2_set_rotation(void *data, unsigned rotation) static void gl2_set_video_mode(void *data, unsigned width, unsigned height, bool fullscreen) { - gfx_ctx_mode_t mode; - - mode.width = width; - mode.height = height; - mode.fullscreen = fullscreen; - - video_context_driver_set_video_mode(&mode); + gl_t *gl = (gl_t*)data; + if (gl->ctx_driver->set_video_mode) + gl->ctx_driver->set_video_mode(gl->ctx_data, + width, height, fullscreen); } static void gl2_update_input_size(gl_t *gl, unsigned width, @@ -3616,8 +3613,6 @@ static void *gl2_init(const video_info_t *video, #endif full_x = mode.width; full_y = mode.height; - mode.width = 0; - mode.height = 0; interval = 0; RARCH_LOG("[GL]: Detecting screen resolution %ux%u.\n", full_x, full_y); @@ -3643,16 +3638,16 @@ static void *gl2_init(const video_info_t *video, win_height = full_y; } - mode.width = win_width; - mode.height = win_height; - mode.fullscreen = video->fullscreen; - - if (!video_context_driver_set_video_mode(&mode)) + if ( !gl->ctx_driver->set_video_mode + || !gl->ctx_driver->set_video_mode(gl->ctx_data, + win_width, win_height, video->fullscreen)) goto error; #if defined(__APPLE__) && !defined(IOS) /* This is a hack for now to work around a very annoying * issue that currently eludes us. */ - if (!video_context_driver_set_video_mode(&mode)) + if ( !gl->ctx_driver->set_video_mode + || !gl->ctx_driver->set_video_mode(gl->ctx_data, + win_width, win_height, video->fullscreen)) goto error; #endif @@ -3771,8 +3766,6 @@ static void *gl2_init(const video_info_t *video, #endif temp_width = mode.width; temp_height = mode.height; - mode.width = 0; - mode.height = 0; /* Get real known video size, which might have been altered by context. */ diff --git a/gfx/drivers/gl1.c b/gfx/drivers/gl1.c index ca48fde5f3..ec991ee22f 100644 --- a/gfx/drivers/gl1.c +++ b/gfx/drivers/gl1.c @@ -316,7 +316,9 @@ static void *gl1_gfx_init(const video_info_t *video, ctx_driver->swap_interval(gl1->ctx_data, interval); } - if (!video_context_driver_set_video_mode(&mode)) + if ( !gl1->ctx_driver->set_video_mode + || !gl1->ctx_driver->set_video_mode(gl1->ctx_data, + win_width, win_height, video->fullscreen)) goto error; gl1->fullscreen = video->fullscreen; @@ -328,8 +330,6 @@ static void *gl1_gfx_init(const video_info_t *video, temp_width = mode.width; temp_height = mode.height; - mode.width = 0; - mode.height = 0; /* Get real known video size, which might have been altered by context. */ @@ -1187,13 +1187,10 @@ static void gl1_get_video_output_next(void *data) static void gl1_set_video_mode(void *data, unsigned width, unsigned height, bool fullscreen) { - gfx_ctx_mode_t mode; - - mode.width = width; - mode.height = height; - mode.fullscreen = fullscreen; - - video_context_driver_set_video_mode(&mode); + gl1_t *gl = (gl1_t*)data; + if (gl->ctx_driver->set_video_mode) + gl->ctx_driver->set_video_mode(gl->ctx_data, + width, height, fullscreen); } static unsigned gl1_wrap_type_to_enum(enum gfx_wrap_type type) diff --git a/gfx/drivers/gl_core.c b/gfx/drivers/gl_core.c index 374ee022c2..e5726995fa 100644 --- a/gfx/drivers/gl_core.c +++ b/gfx/drivers/gl_core.c @@ -1211,11 +1211,9 @@ static void *gl_core_init(const video_info_t *video, win_height = full_y; } - mode.width = win_width; - mode.height = win_height; - mode.fullscreen = video->fullscreen; - - if (!video_context_driver_set_video_mode(&mode)) + if ( !gl->ctx_driver->set_video_mode + || !gl->ctx_driver->set_video_mode(gl->ctx_data, + win_width, win_height, video->fullscreen)) goto error; gl_core_context_bind_hw_render(gl, false); @@ -1290,9 +1288,6 @@ static void *gl_core_init(const video_info_t *video, temp_width = mode.width; temp_height = mode.height; - mode.width = 0; - mode.height = 0; - /* Get real known video size, which might have been altered by context. */ if (temp_width != 0 && temp_height != 0) @@ -2124,13 +2119,10 @@ static void gl_core_unload_texture(void *data, bool threaded, static void gl_core_set_video_mode(void *data, unsigned width, unsigned height, bool fullscreen) { - gfx_ctx_mode_t mode; - - mode.width = width; - mode.height = height; - mode.fullscreen = fullscreen; - - video_context_driver_set_video_mode(&mode); + gl_core_t *gl = (gl_core_t*)data; + if (gl->ctx_driver->set_video_mode) + gl->ctx_driver->set_video_mode(gl->ctx_data, + width, height, fullscreen); } static void gl_core_show_mouse(void *data, bool state) diff --git a/gfx/drivers/vg.c b/gfx/drivers/vg.c index 8e9ac13f42..6213fbfa21 100644 --- a/gfx/drivers/vg.c +++ b/gfx/drivers/vg.c @@ -142,8 +142,6 @@ static void *vg_init(const video_info_t *video, temp_width = mode.width; temp_height = mode.height; - mode.width = 0; - mode.height = 0; RARCH_LOG("[VG]: Detecting screen resolution %ux%u.\n", temp_width, temp_height); @@ -173,11 +171,9 @@ static void *vg_init(const video_info_t *video, win_height = temp_height; } - mode.width = win_width; - mode.height = win_height; - mode.fullscreen = video->fullscreen; - - if (!video_context_driver_set_video_mode(&mode)) + if ( !vg->ctx_driver->set_video_mode + || !vg->ctx_driver->set_video_mode(vg->ctx_data, + win_width, win_height, video->fullscreen)) goto error; video_driver_get_size(&temp_width, &temp_height); @@ -191,8 +187,6 @@ static void *vg_init(const video_info_t *video, temp_width = mode.width; temp_height = mode.height; - mode.width = 0; - mode.height = 0; vg->should_resize = true; diff --git a/gfx/drivers/vulkan.c b/gfx/drivers/vulkan.c index e4630c1fe3..4cbf9d30cc 100644 --- a/gfx/drivers/vulkan.c +++ b/gfx/drivers/vulkan.c @@ -1217,11 +1217,9 @@ static void *vulkan_init(const video_info_t *video, win_height = full_y; } - mode.width = win_width; - mode.height = win_height; - mode.fullscreen = video->fullscreen; - - if (!video_context_driver_set_video_mode(&mode)) + if ( !vk->ctx_driver->set_video_mode + || !vk->ctx_driver->set_video_mode(vk->ctx_data, + win_width, win_height, video->fullscreen)) { RARCH_ERR("[Vulkan]: Failed to set video mode.\n"); goto error; @@ -1456,15 +1454,10 @@ static void vulkan_set_video_mode(void *data, unsigned width, unsigned height, bool fullscreen) { - gfx_ctx_mode_t mode; - - (void)data; - - mode.width = width; - mode.height = height; - mode.fullscreen = fullscreen; - - video_context_driver_set_video_mode(&mode); + vk_t *vk = (vk_t*)data; + if (vk->ctx_driver->set_video_mode) + vk->ctx_driver->set_video_mode(vk->ctx_data, + width, height, fullscreen); } static void vulkan_set_viewport(void *data, unsigned viewport_width, diff --git a/retroarch.c b/retroarch.c index d17efb8853..024825804b 100644 --- a/retroarch.c +++ b/retroarch.c @@ -31465,9 +31465,7 @@ bool video_driver_set_rotation(unsigned rotation) bool video_driver_set_video_mode(unsigned width, unsigned height, bool fullscreen) { - gfx_ctx_mode_t mode; struct rarch_state *p_rarch = &rarch_st; - if ( p_rarch->video_driver_poke && p_rarch->video_driver_poke->set_video_mode) { @@ -31475,12 +31473,7 @@ bool video_driver_set_video_mode(unsigned width, width, height, fullscreen); return true; } - - mode.width = width; - mode.height = height; - mode.fullscreen = fullscreen; - - return video_context_driver_set_video_mode(&mode); + return false; } bool video_driver_get_video_output_size(unsigned *width, unsigned *height) @@ -33384,16 +33377,6 @@ bool video_context_driver_get_ident(gfx_ctx_ident_t *ident) return true; } -bool video_context_driver_set_video_mode(gfx_ctx_mode_t *mode_info) -{ - struct rarch_state *p_rarch = &rarch_st; - if (!p_rarch->current_video_context.set_video_mode) - return false; - return p_rarch->current_video_context.set_video_mode( - p_rarch->video_context_data, mode_info->width, - mode_info->height, mode_info->fullscreen); -} - bool video_context_driver_get_video_size(gfx_ctx_mode_t *mode_info) { struct rarch_state *p_rarch = &rarch_st; diff --git a/retroarch.h b/retroarch.h index 9ca5f8b03f..d970b90190 100644 --- a/retroarch.h +++ b/retroarch.h @@ -1770,8 +1770,6 @@ void video_context_driver_destroy(void); 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_get_video_size(gfx_ctx_mode_t *mode_info); bool video_context_driver_get_refresh_rate(float *refresh_rate);