mirror of
https://github.com/libretro/RetroArch
synced 2025-01-26 09:35:21 +00:00
Add get_video_output_size callback to video context driver
This commit is contained in:
parent
07772e0e3a
commit
aafc647724
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user