diff --git a/apple/common/apple_gfx_context.c.inl b/apple/common/apple_gfx_context.c.inl index 5e27a6d12d..d0c5b9f9b4 100644 --- a/apple/common/apple_gfx_context.c.inl +++ b/apple/common/apple_gfx_context.c.inl @@ -402,6 +402,7 @@ const gfx_ctx_driver_t gfx_ctx_apple = { apple_gfx_ctx_set_video_mode, apple_gfx_ctx_get_video_size, NULL, + NULL, apple_gfx_ctx_update_window_title, apple_gfx_ctx_check_window, apple_gfx_ctx_set_resize, diff --git a/gfx/drivers_context/androidegl_ctx.c b/gfx/drivers_context/androidegl_ctx.c index 8b406ddd85..3cf346715e 100644 --- a/gfx/drivers_context/androidegl_ctx.c +++ b/gfx/drivers_context/androidegl_ctx.c @@ -381,6 +381,7 @@ const gfx_ctx_driver_t gfx_ctx_android = { android_gfx_ctx_set_video_mode, android_gfx_ctx_get_video_size, NULL, + NULL, android_gfx_ctx_update_window_title, android_gfx_ctx_check_window, android_gfx_ctx_set_resize, diff --git a/gfx/drivers_context/bbqnx_ctx.c b/gfx/drivers_context/bbqnx_ctx.c index 56d8e1ac8f..5d10348eff 100644 --- a/gfx/drivers_context/bbqnx_ctx.c +++ b/gfx/drivers_context/bbqnx_ctx.c @@ -452,6 +452,7 @@ const gfx_ctx_driver_t gfx_ctx_bbqnx = { gfx_ctx_qnx_set_video_mode, gfx_ctx_qnx_get_video_size, NULL, + NULL, gfx_ctx_qnx_update_window_title, gfx_ctx_qnx_check_window, gfx_ctx_qnx_set_resize, diff --git a/gfx/drivers_context/d3d_ctx.cpp b/gfx/drivers_context/d3d_ctx.cpp index 259615436b..df15bcae73 100644 --- a/gfx/drivers_context/d3d_ctx.cpp +++ b/gfx/drivers_context/d3d_ctx.cpp @@ -500,6 +500,7 @@ const gfx_ctx_driver_t gfx_ctx_d3d = { NULL, gfx_ctx_d3d_get_video_size, NULL, + NULL, gfx_ctx_d3d_update_title, gfx_ctx_d3d_check_window, d3d_resize, diff --git a/gfx/drivers_context/drm_egl_ctx.c b/gfx/drivers_context/drm_egl_ctx.c index a79a81953e..0111bb6679 100644 --- a/gfx/drivers_context/drm_egl_ctx.c +++ b/gfx/drivers_context/drm_egl_ctx.c @@ -958,6 +958,7 @@ const gfx_ctx_driver_t gfx_ctx_drm_egl = { gfx_ctx_drm_egl_set_video_mode, gfx_ctx_drm_egl_get_video_size, NULL, + NULL, gfx_ctx_drm_egl_update_window_title, gfx_ctx_drm_egl_check_window, gfx_ctx_drm_egl_set_resize, diff --git a/gfx/drivers_context/emscriptenegl_ctx.c b/gfx/drivers_context/emscriptenegl_ctx.c index 7715be30e8..744237d42c 100644 --- a/gfx/drivers_context/emscriptenegl_ctx.c +++ b/gfx/drivers_context/emscriptenegl_ctx.c @@ -308,6 +308,7 @@ const gfx_ctx_driver_t gfx_ctx_emscripten = { gfx_ctx_emscripten_swap_interval, gfx_ctx_emscripten_set_video_mode, gfx_ctx_emscripten_get_video_size, + NULL, gfx_ctx_emscripten_translate_aspect, gfx_ctx_emscripten_update_window_title, gfx_ctx_emscripten_check_window, diff --git a/gfx/drivers_context/gfx_null_ctx.c b/gfx/drivers_context/gfx_null_ctx.c index 285f214cc4..aca851c1d7 100644 --- a/gfx/drivers_context/gfx_null_ctx.c +++ b/gfx/drivers_context/gfx_null_ctx.c @@ -141,6 +141,7 @@ const gfx_ctx_driver_t gfx_ctx_null = { gfx_ctx_null_set_video_mode, gfx_ctx_null_get_video_size, NULL, + NULL, gfx_ctx_null_update_window_title, gfx_ctx_null_check_window, gfx_ctx_null_set_resize, diff --git a/gfx/drivers_context/glx_ctx.c b/gfx/drivers_context/glx_ctx.c index 967d67652c..0e544386cb 100644 --- a/gfx/drivers_context/glx_ctx.c +++ b/gfx/drivers_context/glx_ctx.c @@ -734,6 +734,7 @@ const gfx_ctx_driver_t gfx_ctx_glx = { gfx_ctx_glx_set_video_mode, gfx_ctx_glx_get_video_size, NULL, + NULL, gfx_ctx_glx_update_window_title, gfx_ctx_glx_check_window, gfx_ctx_glx_set_resize, diff --git a/gfx/drivers_context/mali_fbdev_ctx.c b/gfx/drivers_context/mali_fbdev_ctx.c index 8baed37863..17993aed67 100644 --- a/gfx/drivers_context/mali_fbdev_ctx.c +++ b/gfx/drivers_context/mali_fbdev_ctx.c @@ -319,6 +319,7 @@ const gfx_ctx_driver_t gfx_ctx_mali_fbdev = { gfx_ctx_mali_fbdev_set_video_mode, gfx_ctx_mali_fbdev_get_video_size, NULL, + NULL, gfx_ctx_mali_fbdev_update_window_title, gfx_ctx_mali_fbdev_check_window, gfx_ctx_mali_fbdev_set_resize, diff --git a/gfx/drivers_context/ps3_ctx.c b/gfx/drivers_context/ps3_ctx.c index 9dc92850d3..9ad105a984 100644 --- a/gfx/drivers_context/ps3_ctx.c +++ b/gfx/drivers_context/ps3_ctx.c @@ -47,22 +47,6 @@ typedef struct gfx_ctx_ps3_data #endif } gfx_ctx_ps3_data_t; -static unsigned gfx_ctx_ps3_get_resolution_width(unsigned resolution_id) -{ - CellVideoOutResolution resolution; - cellVideoOutGetResolution(resolution_id, &resolution); - - return resolution.width; -} - -static unsigned gfx_ctx_ps3_get_resolution_height(unsigned resolution_id) -{ - CellVideoOutResolution resolution; - cellVideoOutGetResolution(resolution_id, &resolution); - - return resolution.height; -} - static float gfx_ctx_ps3_get_aspect_ratio(void *data) { CellVideoOutState videoState; @@ -240,6 +224,19 @@ static void gfx_ctx_ps3_get_video_size(void *data, #endif } +static void gfx_ctx_ps3_get_video_output_size(void *data, + unsigned *width, unsigned *height) +{ + if (!width || !height) + return; + + CellVideoOutResolution resolution; + cellVideoOutGetResolution(resolution_id, &resolution); + + *width = resolution.width; + *height = resolution.height; +} + static bool gfx_ctx_ps3_init(void *data) { gfx_ctx_ps3_data_t *ps3 = (gfx_ctx_ps3_data_t*) @@ -379,6 +376,7 @@ const gfx_ctx_driver_t gfx_ctx_ps3 = { gfx_ctx_ps3_set_swap_interval, gfx_ctx_ps3_set_video_mode, gfx_ctx_ps3_get_video_size, + gfx_ctx_ps3_get_video_output_size, NULL, gfx_ctx_ps3_update_window_title, gfx_ctx_ps3_check_window, diff --git a/gfx/drivers_context/sdl_gl_ctx.c b/gfx/drivers_context/sdl_gl_ctx.c index 9691495ad3..072c458afb 100644 --- a/gfx/drivers_context/sdl_gl_ctx.c +++ b/gfx/drivers_context/sdl_gl_ctx.c @@ -421,6 +421,7 @@ const gfx_ctx_driver_t gfx_ctx_sdl_gl = sdl_ctx_swap_interval, sdl_ctx_set_video_mode, sdl_ctx_get_video_size, + NULL, /* get_video_output_size */ NULL, /* translate_aspect */ sdl_ctx_update_window_title, sdl_ctx_check_window, diff --git a/gfx/drivers_context/vc_egl_ctx.c b/gfx/drivers_context/vc_egl_ctx.c index e4f4f90ab9..35dacfd6d0 100644 --- a/gfx/drivers_context/vc_egl_ctx.c +++ b/gfx/drivers_context/vc_egl_ctx.c @@ -640,6 +640,7 @@ const gfx_ctx_driver_t gfx_ctx_videocore = { gfx_ctx_vc_swap_interval, gfx_ctx_vc_set_video_mode, gfx_ctx_vc_get_video_size, + NULL, gfx_ctx_vc_translate_aspect, gfx_ctx_vc_update_window_title, gfx_ctx_vc_check_window, diff --git a/gfx/drivers_context/vivante_fbdev_ctx.c b/gfx/drivers_context/vivante_fbdev_ctx.c index c20e1500c1..d5d76a286a 100644 --- a/gfx/drivers_context/vivante_fbdev_ctx.c +++ b/gfx/drivers_context/vivante_fbdev_ctx.c @@ -304,6 +304,7 @@ const gfx_ctx_driver_t gfx_ctx_vivante_fbdev = { gfx_ctx_vivante_set_video_mode, gfx_ctx_vivante_get_video_size, NULL, + NULL, gfx_ctx_vivante_update_window_title, gfx_ctx_vivante_check_window, gfx_ctx_vivante_set_resize, diff --git a/gfx/drivers_context/wayland_ctx.c b/gfx/drivers_context/wayland_ctx.c index e43e1379d4..66cdf63af6 100644 --- a/gfx/drivers_context/wayland_ctx.c +++ b/gfx/drivers_context/wayland_ctx.c @@ -881,6 +881,7 @@ const gfx_ctx_driver_t gfx_ctx_wayland = { gfx_ctx_wl_set_video_mode, gfx_ctx_wl_get_video_size, NULL, + NULL, gfx_ctx_wl_update_window_title, gfx_ctx_wl_check_window, gfx_ctx_wl_set_resize, diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index f6e6a574f2..cf7477eaf9 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -685,6 +685,7 @@ const gfx_ctx_driver_t gfx_ctx_wgl = { gfx_ctx_wgl_set_video_mode, gfx_ctx_wgl_get_video_size, NULL, + NULL, gfx_ctx_wgl_update_window_title, gfx_ctx_wgl_check_window, gfx_ctx_wgl_set_resize, diff --git a/gfx/drivers_context/xegl_ctx.c b/gfx/drivers_context/xegl_ctx.c index 885abf35a3..6e2e7c68dc 100644 --- a/gfx/drivers_context/xegl_ctx.c +++ b/gfx/drivers_context/xegl_ctx.c @@ -800,6 +800,7 @@ const gfx_ctx_driver_t gfx_ctx_x_egl = { gfx_ctx_xegl_set_video_mode, gfx_ctx_xegl_get_video_size, NULL, + NULL, gfx_ctx_xegl_update_window_title, gfx_ctx_xegl_check_window, gfx_ctx_xegl_set_resize, diff --git a/gfx/video_context_driver.h b/gfx/video_context_driver.h index fb7aaaca42..b297be67fe 100644 --- a/gfx/video_context_driver.h +++ b/gfx/video_context_driver.h @@ -70,6 +70,8 @@ typedef struct gfx_ctx_driver * If not initialized yet, it returns current screen size. */ void (*get_video_size)(void*, unsigned*, unsigned*); + void (*get_video_output_size)(void*, unsigned*, unsigned*); + /* Translates a window size to an aspect ratio. * In most cases this will be just width / height, but * some contexts will better know which actual aspect ratio is used.