mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
Get rid of these context driver higher level functions
This commit is contained in:
parent
9f653f27b0
commit
27b09229b3
@ -4393,20 +4393,28 @@ static void gl2_apply_state_changes(void *data)
|
|||||||
static void gl2_get_video_output_size(void *data,
|
static void gl2_get_video_output_size(void *data,
|
||||||
unsigned *width, unsigned *height)
|
unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
gfx_ctx_size_t size_data;
|
gl_t *gl = (gl_t*)data;
|
||||||
size_data.width = width;
|
if (!gl || !gl->ctx_driver || !gl->ctx_driver->get_video_output_size)
|
||||||
size_data.height = height;
|
return;
|
||||||
video_context_driver_get_video_output_size(&size_data);
|
gl->ctx_driver->get_video_output_size(
|
||||||
|
gl->ctx_data,
|
||||||
|
width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gl2_get_video_output_prev(void *data)
|
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)
|
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(
|
static void video_texture_load_gl2(
|
||||||
|
@ -1163,20 +1163,28 @@ static void gl1_set_texture_frame(void *data,
|
|||||||
static void gl1_get_video_output_size(void *data,
|
static void gl1_get_video_output_size(void *data,
|
||||||
unsigned *width, unsigned *height)
|
unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
gfx_ctx_size_t size_data;
|
gl1_t *gl = (gl1_t*)data;
|
||||||
size_data.width = width;
|
if (!gl || !gl->ctx_driver || !gl->ctx_driver->get_video_output_size)
|
||||||
size_data.height = height;
|
return;
|
||||||
video_context_driver_get_video_output_size(&size_data);
|
gl->ctx_driver->get_video_output_size(
|
||||||
|
gl->ctx_data,
|
||||||
|
width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gl1_get_video_output_prev(void *data)
|
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)
|
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,
|
static void gl1_set_video_mode(void *data, unsigned width, unsigned height,
|
||||||
|
@ -2187,20 +2187,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,
|
static void gl_core_get_video_output_size(void *data,
|
||||||
unsigned *width, unsigned *height)
|
unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
gfx_ctx_size_t size_data;
|
gl_core_t *gl = (gl_core_t*)data;
|
||||||
size_data.width = width;
|
if (!gl || !gl->ctx_driver || !gl->ctx_driver->get_video_output_size)
|
||||||
size_data.height = height;
|
return;
|
||||||
video_context_driver_get_video_output_size(&size_data);
|
gl->ctx_driver->get_video_output_size(
|
||||||
|
gl->ctx_data,
|
||||||
|
width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gl_core_get_video_output_prev(void *data)
|
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)
|
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)
|
static uintptr_t gl_core_get_current_framebuffer(void *data)
|
||||||
|
@ -2543,20 +2543,28 @@ static uint32_t vulkan_get_flags(void *data)
|
|||||||
static void vulkan_get_video_output_size(void *data,
|
static void vulkan_get_video_output_size(void *data,
|
||||||
unsigned *width, unsigned *height)
|
unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
gfx_ctx_size_t size_data;
|
vk_t *vk = (vk_t*)data;
|
||||||
size_data.width = width;
|
if (!vk || !vk->ctx_driver || !vk->ctx_driver->get_video_output_size)
|
||||||
size_data.height = height;
|
return;
|
||||||
video_context_driver_get_video_output_size(&size_data);
|
vk->ctx_driver->get_video_output_size(
|
||||||
|
vk->ctx_data,
|
||||||
|
width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vulkan_get_video_output_prev(void *data)
|
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)
|
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 = {
|
static const video_poke_interface_t vulkan_poke_interface = {
|
||||||
|
56
retroarch.c
56
retroarch.c
@ -31922,16 +31922,30 @@ bool video_driver_supports_rgba(void)
|
|||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool video_context_driver_get_video_output_next(struct
|
||||||
|
rarch_state *p_rarch)
|
||||||
|
{
|
||||||
|
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)
|
bool video_driver_get_next_video_out(void)
|
||||||
{
|
{
|
||||||
struct rarch_state *p_rarch = &rarch_st;
|
struct rarch_state *p_rarch = &rarch_st;
|
||||||
if (!p_rarch->video_driver_poke)
|
if (!p_rarch->video_driver_poke)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!p_rarch->video_driver_poke->get_video_output_next)
|
if (p_rarch->video_driver_poke->get_video_output_next)
|
||||||
return video_context_driver_get_video_output_next();
|
{
|
||||||
p_rarch->video_driver_poke->get_video_output_next(p_rarch->video_driver_data);
|
p_rarch->video_driver_poke->get_video_output_next(
|
||||||
return true;
|
p_rarch->video_driver_data);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return video_context_driver_get_video_output_next(p_rarch);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool video_driver_get_prev_video_out(void)
|
bool video_driver_get_prev_video_out(void)
|
||||||
@ -31940,10 +31954,13 @@ bool video_driver_get_prev_video_out(void)
|
|||||||
if (!p_rarch->video_driver_poke)
|
if (!p_rarch->video_driver_poke)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!p_rarch->video_driver_poke->get_video_output_prev)
|
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);
|
p_rarch->video_driver_poke->get_video_output_prev(
|
||||||
return true;
|
p_rarch->video_driver_data);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return video_context_driver_get_video_output_prev();
|
||||||
}
|
}
|
||||||
|
|
||||||
void video_driver_monitor_reset(void)
|
void video_driver_monitor_reset(void)
|
||||||
@ -33348,16 +33365,6 @@ bool video_context_driver_get_video_output_prev(void)
|
|||||||
return true;
|
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_translate_aspect(gfx_ctx_aspect_t *aspect)
|
void video_context_driver_translate_aspect(gfx_ctx_aspect_t *aspect)
|
||||||
{
|
{
|
||||||
struct rarch_state *p_rarch = &rarch_st;
|
struct rarch_state *p_rarch = &rarch_st;
|
||||||
@ -33376,19 +33383,6 @@ void video_context_driver_free(void)
|
|||||||
p_rarch->video_context_data = NULL;
|
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)
|
bool video_context_driver_get_metrics(gfx_ctx_metrics_t *metrics)
|
||||||
{
|
{
|
||||||
struct rarch_state *p_rarch = &rarch_st;
|
struct rarch_state *p_rarch = &rarch_st;
|
||||||
|
@ -1768,14 +1768,10 @@ bool video_context_driver_write_to_image_buffer(gfx_ctx_image_t *img);
|
|||||||
|
|
||||||
bool video_context_driver_get_video_output_prev(void);
|
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);
|
bool video_context_driver_set(const gfx_ctx_driver_t *data);
|
||||||
|
|
||||||
void video_context_driver_destroy(void);
|
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_get_ident(gfx_ctx_ident_t *ident);
|
||||||
|
|
||||||
bool video_context_driver_set_video_mode(gfx_ctx_mode_t *mode_info);
|
bool video_context_driver_set_video_mode(gfx_ctx_mode_t *mode_info);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user