mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Cleanup context driver video output functions
This commit is contained in:
parent
3e04b158ab
commit
dc94356505
@ -4386,20 +4386,28 @@ static void gl2_apply_state_changes(void *data)
|
||||
static void gl2_get_video_output_size(void *data,
|
||||
unsigned *width, unsigned *height)
|
||||
{
|
||||
gfx_ctx_size_t size_data;
|
||||
size_data.width = width;
|
||||
size_data.height = height;
|
||||
video_context_driver_get_video_output_size(&size_data);
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if (!gl || !gl->ctx_driver || !gl->ctx_driver->get_video_output_size)
|
||||
return;
|
||||
gl->ctx_driver->get_video_output_size(
|
||||
gl->ctx_data,
|
||||
width, height);
|
||||
}
|
||||
|
||||
static void gl2_get_video_output_prev(void *data)
|
||||
{
|
||||
video_context_driver_get_video_output_prev();
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if (!gl || !gl->ctx_driver || !gl->ctx_driver->get_video_output_prev)
|
||||
return;
|
||||
gl->ctx_driver->get_video_output_prev(gl->ctx_data);
|
||||
}
|
||||
|
||||
static void gl2_get_video_output_next(void *data)
|
||||
{
|
||||
video_context_driver_get_video_output_next();
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if (!gl || !gl->ctx_driver || !gl->ctx_driver->get_video_output_next)
|
||||
return;
|
||||
gl->ctx_driver->get_video_output_next(gl->ctx_data);
|
||||
}
|
||||
|
||||
static void video_texture_load_gl2(
|
||||
|
@ -1160,20 +1160,28 @@ static void gl1_set_texture_frame(void *data,
|
||||
static void gl1_get_video_output_size(void *data,
|
||||
unsigned *width, unsigned *height)
|
||||
{
|
||||
gfx_ctx_size_t size_data;
|
||||
size_data.width = width;
|
||||
size_data.height = height;
|
||||
video_context_driver_get_video_output_size(&size_data);
|
||||
gl1_t *gl = (gl1_t*)data;
|
||||
if (!gl || !gl->ctx_driver || !gl->ctx_driver->get_video_output_size)
|
||||
return;
|
||||
gl->ctx_driver->get_video_output_size(
|
||||
gl->ctx_data,
|
||||
width, height);
|
||||
}
|
||||
|
||||
static void gl1_get_video_output_prev(void *data)
|
||||
{
|
||||
video_context_driver_get_video_output_prev();
|
||||
gl1_t *gl = (gl1_t*)data;
|
||||
if (!gl || !gl->ctx_driver || !gl->ctx_driver->get_video_output_prev)
|
||||
return;
|
||||
gl->ctx_driver->get_video_output_prev(gl->ctx_data);
|
||||
}
|
||||
|
||||
static void gl1_get_video_output_next(void *data)
|
||||
{
|
||||
video_context_driver_get_video_output_next();
|
||||
gl1_t *gl = (gl1_t*)data;
|
||||
if (!gl || !gl->ctx_driver || !gl->ctx_driver->get_video_output_next)
|
||||
return;
|
||||
gl->ctx_driver->get_video_output_next(gl->ctx_data);
|
||||
}
|
||||
|
||||
static void gl1_set_video_mode(void *data, unsigned width, unsigned height,
|
||||
|
@ -2184,20 +2184,28 @@ static void gl_core_set_texture_enable(void *data, bool state, bool full_screen)
|
||||
static void gl_core_get_video_output_size(void *data,
|
||||
unsigned *width, unsigned *height)
|
||||
{
|
||||
gfx_ctx_size_t size_data;
|
||||
size_data.width = width;
|
||||
size_data.height = height;
|
||||
video_context_driver_get_video_output_size(&size_data);
|
||||
gl_core_t *gl = (gl_core_t*)data;
|
||||
if (!gl || !gl->ctx_driver || !gl->ctx_driver->get_video_output_size)
|
||||
return;
|
||||
gl->ctx_driver->get_video_output_size(
|
||||
gl->ctx_data,
|
||||
width, height);
|
||||
}
|
||||
|
||||
static void gl_core_get_video_output_prev(void *data)
|
||||
{
|
||||
video_context_driver_get_video_output_prev();
|
||||
gl_core_t *gl = (gl_core_t*)data;
|
||||
if (!gl || !gl->ctx_driver || !gl->ctx_driver->get_video_output_prev)
|
||||
return;
|
||||
gl->ctx_driver->get_video_output_prev(gl->ctx_data);
|
||||
}
|
||||
|
||||
static void gl_core_get_video_output_next(void *data)
|
||||
{
|
||||
video_context_driver_get_video_output_next();
|
||||
gl_core_t *gl = (gl_core_t*)data;
|
||||
if (!gl || !gl->ctx_driver || !gl->ctx_driver->get_video_output_next)
|
||||
return;
|
||||
gl->ctx_driver->get_video_output_next(gl->ctx_data);
|
||||
}
|
||||
|
||||
static uintptr_t gl_core_get_current_framebuffer(void *data)
|
||||
|
@ -2540,20 +2540,28 @@ static uint32_t vulkan_get_flags(void *data)
|
||||
static void vulkan_get_video_output_size(void *data,
|
||||
unsigned *width, unsigned *height)
|
||||
{
|
||||
gfx_ctx_size_t size_data;
|
||||
size_data.width = width;
|
||||
size_data.height = height;
|
||||
video_context_driver_get_video_output_size(&size_data);
|
||||
vk_t *vk = (vk_t*)data;
|
||||
if (!vk || !vk->ctx_driver || !vk->ctx_driver->get_video_output_size)
|
||||
return;
|
||||
vk->ctx_driver->get_video_output_size(
|
||||
vk->ctx_data,
|
||||
width, height);
|
||||
}
|
||||
|
||||
static void vulkan_get_video_output_prev(void *data)
|
||||
{
|
||||
video_context_driver_get_video_output_prev();
|
||||
vk_t *vk = (vk_t*)data;
|
||||
if (!vk || !vk->ctx_driver || !vk->ctx_driver->get_video_output_prev)
|
||||
return;
|
||||
vk->ctx_driver->get_video_output_prev(vk->ctx_data);
|
||||
}
|
||||
|
||||
static void vulkan_get_video_output_next(void *data)
|
||||
{
|
||||
video_context_driver_get_video_output_next();
|
||||
vk_t *vk = (vk_t*)data;
|
||||
if (!vk || !vk->ctx_driver || !vk->ctx_driver->get_video_output_next)
|
||||
return;
|
||||
vk->ctx_driver->get_video_output_next(vk->ctx_data);
|
||||
}
|
||||
|
||||
static const video_poke_interface_t vulkan_poke_interface = {
|
||||
|
56
retroarch.c
56
retroarch.c
@ -31922,6 +31922,27 @@ bool video_driver_supports_rgba(void)
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static bool video_context_driver_get_video_output_prev(void)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
if (!p_rarch->current_video_context.get_video_output_prev)
|
||||
return false;
|
||||
p_rarch->current_video_context.get_video_output_prev(
|
||||
p_rarch->video_context_data);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool video_context_driver_get_video_output_next(void)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
if (!p_rarch->current_video_context.get_video_output_next)
|
||||
return false;
|
||||
p_rarch->current_video_context.get_video_output_next(
|
||||
p_rarch->video_context_data);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool video_driver_get_next_video_out(void)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
@ -31941,7 +31962,9 @@ bool video_driver_get_prev_video_out(void)
|
||||
return false;
|
||||
|
||||
if (!p_rarch->video_driver_poke->get_video_output_prev)
|
||||
{
|
||||
return video_context_driver_get_video_output_prev();
|
||||
}
|
||||
p_rarch->video_driver_poke->get_video_output_prev(p_rarch->video_driver_data);
|
||||
return true;
|
||||
}
|
||||
@ -33325,26 +33348,6 @@ const gfx_ctx_driver_t *video_context_driver_init_first(void *data,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool video_context_driver_get_video_output_prev(void)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
if (!p_rarch->current_video_context.get_video_output_prev)
|
||||
return false;
|
||||
p_rarch->current_video_context.get_video_output_prev(
|
||||
p_rarch->video_context_data);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool video_context_driver_get_video_output_next(void)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
if (!p_rarch->current_video_context.get_video_output_next)
|
||||
return false;
|
||||
p_rarch->current_video_context.get_video_output_next(
|
||||
p_rarch->video_context_data);
|
||||
return true;
|
||||
}
|
||||
|
||||
void video_context_driver_free(void)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
@ -33354,19 +33357,6 @@ void video_context_driver_free(void)
|
||||
p_rarch->video_context_data = NULL;
|
||||
}
|
||||
|
||||
bool video_context_driver_get_video_output_size(gfx_ctx_size_t *size_data)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
if (!size_data)
|
||||
return false;
|
||||
if (!p_rarch->current_video_context.get_video_output_size)
|
||||
return false;
|
||||
p_rarch->current_video_context.get_video_output_size(
|
||||
p_rarch->video_context_data,
|
||||
size_data->width, size_data->height);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool video_context_driver_get_metrics(gfx_ctx_metrics_t *metrics)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
|
@ -1764,16 +1764,10 @@ const gfx_ctx_driver_t *video_context_driver_init_first(
|
||||
enum gfx_ctx_api api, unsigned major, unsigned minor,
|
||||
bool hw_render_ctx, void **ctx_data);
|
||||
|
||||
bool video_context_driver_get_video_output_prev(void);
|
||||
|
||||
bool video_context_driver_get_video_output_next(void);
|
||||
|
||||
bool video_context_driver_set(const gfx_ctx_driver_t *data);
|
||||
|
||||
void video_context_driver_destroy(void);
|
||||
|
||||
bool video_context_driver_get_video_output_size(gfx_ctx_size_t *size_data);
|
||||
|
||||
bool video_context_driver_get_ident(gfx_ctx_ident_t *ident);
|
||||
|
||||
bool video_context_driver_set_video_mode(gfx_ctx_mode_t *mode_info);
|
||||
|
Loading…
x
Reference in New Issue
Block a user