diff --git a/gfx/drivers/caca_gfx.c b/gfx/drivers/caca_gfx.c index 409badc683..5eafc07678 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,8 +61,6 @@ 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, @@ -88,6 +86,9 @@ 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 3eaf8e0773..79bc079017 100644 --- a/gfx/drivers/ctr_gfx.c +++ b/gfx/drivers/ctr_gfx.c @@ -305,7 +305,9 @@ 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_driver_set_size(&ctr->vp.width, &ctr->vp.height); + + video->real_width = ctr->vp.width; + video->real_height = 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 cfeaa8eaeb..0d047c3fbc 100644 --- a/gfx/drivers/gdi_gfx.c +++ b/gfx/drivers/gdi_gfx.c @@ -115,27 +115,18 @@ 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); - temp_width = mode.width; - temp_height = mode.height; - mode.width = 0; - mode.height = 0; + video->real_width = mode.width; + video->real_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) - 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; + 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 3d97f7fdf3..173fc099f1 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -1913,10 +1913,11 @@ static void *gl_init(video_info_t *video, const input_driver_t **input, void **i video_context_driver_get_video_size(&mode); - video->real_width = mode.width; - video->real_height = mode.height; - mode.width = 0; - mode.height = 0; + if (mode.width != 0 && mode.height != 0) + { + video->real_width = mode.width; + video->real_height = mode.height; + } hwr = video_driver_get_hw_context(); diff --git a/gfx/drivers/vita2d_gfx.c b/gfx/drivers/vita2d_gfx.c index 14669057eb..3f3137efb7 100644 --- a/gfx/drivers/vita2d_gfx.c +++ b/gfx/drivers/vita2d_gfx.c @@ -91,7 +91,9 @@ 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_driver_set_size(&temp_width, &temp_height); + video->real_width = temp_width; + video->real_height = 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 4109d9a27e..5a94087616 100644 --- a/gfx/drivers/vulkan.c +++ b/gfx/drivers/vulkan.c @@ -1129,14 +1129,15 @@ static void *vulkan_init(video_info_t *video, } video_context_driver_get_video_size(&mode); - 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); + temp_width = mode.width; + temp_height = mode.height; - RARCH_LOG("[Vulkan]: Using resolution %ux%u\n", temp_width, temp_height); + if (mode.width != 0 && mode.height != 0) + { + video->real_width = temp_width; + video->real_height = 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 48579c0257..da108d27bd 100644 --- a/gfx/drivers/wiiu_gfx.c +++ b/gfx/drivers/wiiu_gfx.c @@ -502,7 +502,9 @@ 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_driver_set_size(&wiiu->vp.width, &wiiu->vp.height); + + video->real_width = wiiu->vp.width; + video->real_height = wiiu->vp.height; driver_ctl(RARCH_DRIVER_CTL_SET_REFRESH_RATE, &refresh_rate);