mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-21 18:21:51 +00:00
Add get_video_output_size to video driver's poke interface
This commit is contained in:
parent
aafc647724
commit
f9ede9d00a
@ -1918,6 +1918,7 @@ static void d3d_set_menu_texture_enable(void *data,
|
||||
|
||||
static const video_poke_interface_t d3d_poke_interface = {
|
||||
NULL,
|
||||
NULL, /* get_video_output_size */
|
||||
#ifdef HAVE_FBO
|
||||
NULL,
|
||||
#endif
|
||||
|
@ -1614,6 +1614,7 @@ static void exynos_show_mouse(void *data, bool state)
|
||||
|
||||
static const video_poke_interface_t exynos_poke_interface = {
|
||||
NULL, /* set_filtering */
|
||||
NULL, /* get_video_output_size */
|
||||
#ifdef HAVE_FBO
|
||||
NULL, /* get_current_framebuffer */
|
||||
#endif
|
||||
|
@ -3090,6 +3090,7 @@ static struct video_shader *gl_get_current_shader(void *data)
|
||||
|
||||
static const video_poke_interface_t gl_poke_interface = {
|
||||
NULL,
|
||||
NULL, /* get_video_output_size */
|
||||
#ifdef HAVE_FBO
|
||||
gl_get_current_framebuffer,
|
||||
#endif
|
||||
|
@ -1150,6 +1150,7 @@ static bool gx_read_viewport(void *data, uint8_t *buffer)
|
||||
|
||||
static const video_poke_interface_t gx_poke_interface = {
|
||||
NULL,
|
||||
NULL, /* get_video_output_size */
|
||||
NULL,
|
||||
gx_set_aspect_ratio,
|
||||
gx_apply_state_changes,
|
||||
|
@ -841,6 +841,7 @@ static void psp_viewport_info(void *data, struct video_viewport *vp)
|
||||
|
||||
static const video_poke_interface_t psp_poke_interface = {
|
||||
psp_set_filtering,
|
||||
NULL, /* get_video_output_size */
|
||||
NULL,
|
||||
NULL,
|
||||
psp_set_aspect_ratio,
|
||||
|
@ -718,6 +718,7 @@ void sdl2_grab_mouse_toggle(void *data)
|
||||
|
||||
static video_poke_interface_t sdl2_video_poke_interface = {
|
||||
sdl2_poke_set_filtering,
|
||||
NULL, /* get_video_output_size */
|
||||
#ifdef HAVE_FBO
|
||||
NULL,
|
||||
#endif
|
||||
|
@ -507,6 +507,7 @@ static void sdl_grab_mouse_toggle(void *data)
|
||||
|
||||
static const video_poke_interface_t sdl_poke_interface = {
|
||||
sdl_set_filtering,
|
||||
NULL, /* get_video_output_size */
|
||||
#ifdef HAVE_FBO
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -93,6 +93,7 @@ enum texture_filter_type
|
||||
typedef struct video_poke_interface
|
||||
{
|
||||
void (*set_filtering)(void *data, unsigned index, bool smooth);
|
||||
void (*get_video_output_size)(void *data, unsigned *width, unsigned *height);
|
||||
#ifdef HAVE_FBO
|
||||
uintptr_t (*get_current_framebuffer)(void *data);
|
||||
#endif
|
||||
|
@ -257,6 +257,14 @@ static void thread_loop(void *data)
|
||||
thread_reply(thr, CMD_POKE_SET_FILTERING);
|
||||
break;
|
||||
|
||||
case CMD_POKE_GET_VIDEO_OUTPUT_SIZE:
|
||||
if (thr->poke && thr->poke->get_video_output_size)
|
||||
thr->poke->get_video_output_size(thr->driver_data,
|
||||
&thr->cmd_data.output.width,
|
||||
&thr->cmd_data.output.height);
|
||||
thread_reply(thr, CMD_POKE_GET_VIDEO_OUTPUT_SIZE);
|
||||
break;
|
||||
|
||||
case CMD_POKE_SET_ASPECT_RATIO:
|
||||
thr->poke->set_aspect_ratio(thr->driver_data,
|
||||
thr->cmd_data.i);
|
||||
@ -759,6 +767,19 @@ static void thread_set_filtering(void *data, unsigned idx, bool smooth)
|
||||
thread_wait_reply(thr, CMD_POKE_SET_FILTERING);
|
||||
}
|
||||
|
||||
static void thread_get_video_output_size(void *data,
|
||||
unsigned *width, unsigned *height)
|
||||
{
|
||||
thread_video_t *thr = (thread_video_t*)data;
|
||||
|
||||
if (!thr)
|
||||
return;
|
||||
thread_send_cmd(thr, CMD_POKE_GET_VIDEO_OUTPUT_SIZE);
|
||||
thread_wait_reply(thr, CMD_POKE_GET_VIDEO_OUTPUT_SIZE);
|
||||
*width = thr->cmd_data.output.width;
|
||||
*height = thr->cmd_data.output.width;
|
||||
}
|
||||
|
||||
static void thread_set_aspect_ratio(void *data, unsigned aspectratio_idx)
|
||||
{
|
||||
thread_video_t *thr = (thread_video_t*)data;
|
||||
@ -852,6 +873,7 @@ static struct video_shader *thread_get_current_shader(void *data)
|
||||
|
||||
static const video_poke_interface_t thread_poke = {
|
||||
thread_set_filtering,
|
||||
thread_get_video_output_size,
|
||||
#ifdef HAVE_FBO
|
||||
NULL,
|
||||
#endif
|
||||
|
@ -42,6 +42,7 @@ enum thread_cmd
|
||||
#endif
|
||||
|
||||
CMD_POKE_SET_FILTERING,
|
||||
CMD_POKE_GET_VIDEO_OUTPUT_SIZE,
|
||||
#ifdef HAVE_FBO
|
||||
CMD_POKE_SET_FBO_STATE,
|
||||
CMD_POKE_GET_FBO_STATE,
|
||||
@ -134,6 +135,12 @@ typedef struct thread_video
|
||||
unsigned num;
|
||||
} image;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
} output;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned index;
|
||||
|
Loading…
x
Reference in New Issue
Block a user