diff --git a/gfx/drivers/caca_gfx.c b/gfx/drivers/caca_gfx.c index 5eafc07678..409badc683 100644 --- a/gfx/drivers/caca_gfx.c +++ b/gfx/drivers/caca_gfx.c @@ -47,11 +47,11 @@ static void caca_gfx_free(void *data); static void caca_gfx_create(void) { caca_display = caca_create_display(NULL); - caca_cv = caca_get_canvas(caca_display); + caca_cv = caca_get_canvas(caca_display); if(!caca_video_width || !caca_video_height) { - caca_video_width = caca_get_canvas_width(caca_cv); + caca_video_width = caca_get_canvas_width(caca_cv); caca_video_height = caca_get_canvas_height(caca_cv); } @@ -61,6 +61,8 @@ static void caca_gfx_create(void) else caca_dither = caca_create_dither(16, caca_video_width, caca_video_height, caca_video_pitch, 0xf800, 0x7e0, 0x1f, 0x0); + + video_driver_set_size(&caca_video_width, &caca_video_height); } static void *caca_gfx_init(video_info_t *video, @@ -86,9 +88,6 @@ static void *caca_gfx_init(video_info_t *video, caca_gfx_create(); - video->real_width = caca_video_width; - video->real_height = caca_video_height; - if (!caca_cv || !caca_dither || !caca_display) { /* TODO: handle errors */ diff --git a/gfx/drivers/ctr_gfx.c b/gfx/drivers/ctr_gfx.c index 79bc079017..3eaf8e0773 100644 --- a/gfx/drivers/ctr_gfx.c +++ b/gfx/drivers/ctr_gfx.c @@ -305,9 +305,7 @@ static void* ctr_init(video_info_t* video, ctr->vp.height = CTR_TOP_FRAMEBUFFER_HEIGHT; ctr->vp.full_width = CTR_TOP_FRAMEBUFFER_WIDTH; ctr->vp.full_height = CTR_TOP_FRAMEBUFFER_HEIGHT; - - video->real_width = ctr->vp.width; - video->real_height = ctr->vp.height; + video_driver_set_size(&ctr->vp.width, &ctr->vp.height); ctr->drawbuffers.top.left = vramAlloc(CTR_TOP_FRAMEBUFFER_WIDTH * CTR_TOP_FRAMEBUFFER_HEIGHT * 2 * sizeof(uint32_t)); ctr->drawbuffers.top.right = (void*)((uint32_t*)ctr->drawbuffers.top.left + CTR_TOP_FRAMEBUFFER_WIDTH * CTR_TOP_FRAMEBUFFER_HEIGHT); diff --git a/gfx/drivers/gdi_gfx.c b/gfx/drivers/gdi_gfx.c index 0d047c3fbc..cfeaa8eaeb 100644 --- a/gfx/drivers/gdi_gfx.c +++ b/gfx/drivers/gdi_gfx.c @@ -115,18 +115,27 @@ static void *gdi_gfx_init(video_info_t *video, if (!video_context_driver_set_video_mode(&mode)) goto error; - mode.width = 0; - mode.height = 0; + mode.width = 0; + mode.height = 0; video_context_driver_get_video_size(&mode); - video->real_width = mode.width; - video->real_height = mode.height; - mode.width = 0; - mode.height = 0; + temp_width = mode.width; + temp_height = mode.height; + mode.width = 0; + mode.height = 0; - inp.input = input; - inp.input_data = input_data; + /* Get real known video size, which might have been altered by context. */ + + if (temp_width != 0 && temp_height != 0) + video_driver_set_size(&temp_width, &temp_height); + + video_driver_get_size(&temp_width, &temp_height); + + RARCH_LOG("[GDI]: Using resolution %ux%u\n", temp_width, temp_height); + + inp.input = input; + inp.input_data = input_data; video_context_driver_input_driver(&inp); diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 173fc099f1..3d97f7fdf3 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -1913,11 +1913,10 @@ static void *gl_init(video_info_t *video, const input_driver_t **input, void **i video_context_driver_get_video_size(&mode); - if (mode.width != 0 && mode.height != 0) - { - video->real_width = mode.width; - video->real_height = mode.height; - } + video->real_width = mode.width; + video->real_height = mode.height; + mode.width = 0; + mode.height = 0; hwr = video_driver_get_hw_context(); diff --git a/gfx/drivers/vita2d_gfx.c b/gfx/drivers/vita2d_gfx.c index 3f3137efb7..14669057eb 100644 --- a/gfx/drivers/vita2d_gfx.c +++ b/gfx/drivers/vita2d_gfx.c @@ -91,9 +91,7 @@ static void *vita2d_gfx_init(video_info_t *video, vita->tex_filter = video->smooth ? SCE_GXM_TEXTURE_FILTER_LINEAR : SCE_GXM_TEXTURE_FILTER_POINT; - video->real_width = temp_width; - video->real_height = temp_height; - + video_driver_set_size(&temp_width, &temp_height); vita2d_gfx_set_viewport(vita, temp_width, temp_height, false, true); diff --git a/gfx/drivers/vulkan.c b/gfx/drivers/vulkan.c index 5a94087616..4109d9a27e 100644 --- a/gfx/drivers/vulkan.c +++ b/gfx/drivers/vulkan.c @@ -1129,15 +1129,14 @@ static void *vulkan_init(video_info_t *video, } video_context_driver_get_video_size(&mode); + temp_width = mode.width; + temp_height = mode.height; - temp_width = mode.width; - temp_height = mode.height; + if (temp_width != 0 && temp_height != 0) + video_driver_set_size(&temp_width, &temp_height); + video_driver_get_size(&temp_width, &temp_height); - if (mode.width != 0 && mode.height != 0) - { - video->real_width = temp_width; - video->real_height = temp_height; - } + RARCH_LOG("[Vulkan]: Using resolution %ux%u\n", temp_width, temp_height); video_context_driver_get_context_data(&vk->context); diff --git a/gfx/drivers/wiiu_gfx.c b/gfx/drivers/wiiu_gfx.c index da108d27bd..48579c0257 100644 --- a/gfx/drivers/wiiu_gfx.c +++ b/gfx/drivers/wiiu_gfx.c @@ -502,9 +502,7 @@ static void* wiiu_gfx_init(video_info_t* video, wiiu->vp.height = wiiu->render_mode.height; wiiu->vp.full_width = wiiu->render_mode.width; wiiu->vp.full_height = wiiu->render_mode.height; - - video->real_width = wiiu->vp.width; - video->real_height = wiiu->vp.height; + video_driver_set_size(&wiiu->vp.width, &wiiu->vp.height); driver_ctl(RARCH_DRIVER_CTL_SET_REFRESH_RATE, &refresh_rate);