diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 48a7413ba1..ce3f7e81ba 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -114,7 +114,7 @@ static const GLfloat white_color[] = { static INLINE void context_bind_hw_render(gl_t *gl, bool enable) { if (gl && gl->shared_context_use) - gfx_ctx_bind_hw_render(enable); + gfx_ctx_ctl(GFX_CTL_BIND_HW_RENDER, &enable); } static INLINE bool gl_query_extension(gl_t *gl, const char *ext) diff --git a/gfx/video_context_driver.c b/gfx/video_context_driver.c index a078053acf..026606e9f4 100644 --- a/gfx/video_context_driver.c +++ b/gfx/video_context_driver.c @@ -118,13 +118,6 @@ bool gfx_ctx_get_video_output_next(void) return true; } -void gfx_ctx_bind_hw_render(bool enable) -{ - if (current_video_context->bind_hw_render) - current_video_context->bind_hw_render(video_context_data, enable); -} - - bool gfx_ctx_set_video_mode( unsigned width, unsigned height, bool fullscreen) @@ -394,6 +387,14 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data) { switch (state) { + case GFX_CTL_BIND_HW_RENDER: + { + bool *enable = (bool*)data; + if (!current_video_context || !current_video_context->bind_hw_render) + return false; + current_video_context->bind_hw_render(video_context_data, *enable); + } + break; case GFX_CTL_SET: if (!data) return false; diff --git a/gfx/video_context_driver.h b/gfx/video_context_driver.h index 325080de1c..bafc429bfc 100644 --- a/gfx/video_context_driver.h +++ b/gfx/video_context_driver.h @@ -61,7 +61,8 @@ enum gfx_ctx_ctl_state GFX_CTL_HAS_WINDOWED, GFX_CTL_UPDATE_WINDOW_TITLE, GFX_CTL_SHOW_MOUSE, - GFX_CTL_SET + GFX_CTL_SET, + GFX_CTL_BIND_HW_RENDER }; typedef void (*gfx_ctx_proc_t)(void); @@ -236,8 +237,6 @@ bool gfx_ctx_set_resize(unsigned width, unsigned height); void gfx_ctx_swap_interval(unsigned interval); -void gfx_ctx_bind_hw_render(bool enable); - void gfx_ctx_get_video_output_size(unsigned *width, unsigned *height); bool gfx_ctx_get_video_output_prev(void);