diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 2b62d1699f..0057f73f07 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -337,13 +337,11 @@ void gl_set_viewport(void *data, video_frame_info_t *video_info, #if defined(HAVE_MENU) if (video_info->aspect_ratio_idx == ASPECT_RATIO_CUSTOM) { - const struct video_viewport *custom = video_viewport_get_custom(); - /* GL has bottom-left origin viewport. */ - x = custom->x; - y = height - custom->y - custom->height; - viewport_width = custom->width; - viewport_height = custom->height; + x = video_info->custom_vp_x; + y = height - video_info->custom_vp_y - video_info->custom_vp_height; + viewport_width = video_info->custom_vp_width; + viewport_height = video_info->custom_vp_height; } else #endif diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 90531899c3..e9cbd02288 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -2255,6 +2255,12 @@ void video_driver_build_info(video_frame_info_t *video_info) video_info->font_msg_color_r = settings->floats.video_msg_color_r; video_info->font_msg_color_g = settings->floats.video_msg_color_g; video_info->font_msg_color_b = settings->floats.video_msg_color_b; + video_info->custom_vp_x = video_viewport_custom.x; + video_info->custom_vp_y = video_viewport_custom.y; + video_info->custom_vp_width = video_viewport_custom.width; + video_info->custom_vp_height = video_viewport_custom.height; + video_info->custom_vp_full_width = video_viewport_custom.full_width; + video_info->custom_vp_full_height = video_viewport_custom.full_height; video_info->fps_text[0] = '\0'; diff --git a/gfx/video_driver.h b/gfx/video_driver.h index cdbbccce47..7d480d231c 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -159,6 +159,13 @@ typedef struct video_frame_info bool is_perfcnt_enable; bool menu_is_alive; + + int custom_vp_x; + int custom_vp_y; + unsigned custom_vp_width; + unsigned custom_vp_height; + unsigned custom_vp_full_width; + unsigned custom_vp_full_height; } video_frame_info_t; /* Optionally implemented interface to poke more