From f65f56fdf4976d8528b08c5e71bd6c2bca433f34 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 10 Apr 2015 09:11:17 +0200 Subject: [PATCH] Go through gfx_ctx_get_video_output wrapper functions --- gfx/drivers/gl.c | 21 +++++---------------- gfx/video_context_driver.c | 25 +++++++++++++++++++++++++ gfx/video_context_driver.h | 7 +++++++ 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index b215ff578b..29a22edd36 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -3147,31 +3147,20 @@ static struct video_shader *gl_get_current_shader(void *data) return (gl && gl->shader) ? gl->shader->get_current_shader() : NULL; } -static void gl_get_video_output_size(void *data, unsigned *width, unsigned *height) +static void gl_get_video_output_size(void *data, + unsigned *width, unsigned *height) { - gl_t *gl = (gl_t*)data; - const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr(); - - if (ctx->get_video_output_size) - ctx->get_video_output_size(gl, width, height); + gfx_ctx_get_video_output_size(data, width, height); } static void gl_get_video_output_prev(void *data) { - gl_t *gl = (gl_t*)data; - const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr(); - - if (ctx->get_video_output_prev) - ctx->get_video_output_prev(gl); + gfx_ctx_get_video_output_prev(data); } static void gl_get_video_output_next(void *data) { - gl_t *gl = (gl_t*)data; - const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr(); - - if (ctx->get_video_output_next) - ctx->get_video_output_next(gl); + gfx_ctx_get_video_output_next(data); } diff --git a/gfx/video_context_driver.c b/gfx/video_context_driver.c index bd6aea8682..32bca51c7f 100644 --- a/gfx/video_context_driver.c +++ b/gfx/video_context_driver.c @@ -99,6 +99,31 @@ void gfx_ctx_update_window_title(void *data) ctx->update_window_title(data); } +void gfx_ctx_get_video_output_size(void *data, + unsigned *width, unsigned *height) +{ + const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr(); + + if (ctx->get_video_output_size) + ctx->get_video_output_size(data, width, height); +} + +void gfx_ctx_get_video_output_prev(void *data) +{ + const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr(); + + if (ctx->get_video_output_prev) + ctx->get_video_output_prev(data); +} + +void gfx_ctx_get_video_output_next(void *data) +{ + const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr(); + + if (ctx->get_video_output_next) + ctx->get_video_output_next(data); +} + void gfx_ctx_swap_buffers(void *data) { const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr(); diff --git a/gfx/video_context_driver.h b/gfx/video_context_driver.h index bed71ca1c9..ca939ebd0f 100644 --- a/gfx/video_context_driver.h +++ b/gfx/video_context_driver.h @@ -238,6 +238,13 @@ void gfx_ctx_swap_interval(void *data, unsigned interval); void gfx_ctx_bind_hw_render(void *data, bool enable); +void gfx_ctx_get_video_output_size(void *data, + unsigned *width, unsigned *height); + +void gfx_ctx_get_video_output_prev(void *data); + +void gfx_ctx_get_video_output_next(void *data); + void gfx_ctx_free(void *data); void gfx_ctx_input_driver(void *data,