From 234baf09bd27629989cc3a00ff9a1d13daed1fd3 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 10 Apr 2015 09:07:53 +0200 Subject: [PATCH] Go through gfx_ctx_bind_hw_render --- gfx/drivers/gl_common.h | 5 ++--- gfx/video_context_driver.c | 8 ++++++++ gfx/video_context_driver.h | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gfx/drivers/gl_common.h b/gfx/drivers/gl_common.h index d2d8467977..c0dc399d28 100644 --- a/gfx/drivers/gl_common.h +++ b/gfx/drivers/gl_common.h @@ -366,12 +366,11 @@ typedef struct gl static INLINE void context_bind_hw_render(gl_t *gl, bool enable) { - const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr(); if (!gl) return; - if (gl->shared_context_use && ctx->bind_hw_render) - ctx->bind_hw_render(gl, enable); + if (gl->shared_context_use) + gfx_ctx_bind_hw_render(gl, enable); } static INLINE bool gl_check_error(void) diff --git a/gfx/video_context_driver.c b/gfx/video_context_driver.c index 6d87da5a36..bd6aea8682 100644 --- a/gfx/video_context_driver.c +++ b/gfx/video_context_driver.c @@ -107,6 +107,14 @@ void gfx_ctx_swap_buffers(void *data) ctx->swap_buffers(data); } +void gfx_ctx_bind_hw_render(void *data, bool enable) +{ + const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr(); + + if (ctx && ctx->bind_hw_render) + ctx->bind_hw_render(data, enable); +} + bool gfx_ctx_focus(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 58600e5e81..bed71ca1c9 100644 --- a/gfx/video_context_driver.h +++ b/gfx/video_context_driver.h @@ -236,6 +236,8 @@ void gfx_ctx_set_resize(void *data, unsigned width, unsigned height); void gfx_ctx_swap_interval(void *data, unsigned interval); +void gfx_ctx_bind_hw_render(void *data, bool enable); + void gfx_ctx_free(void *data); void gfx_ctx_input_driver(void *data,