diff --git a/gfx/drivers/gl_common.h b/gfx/drivers/gl_common.h index 670dfef590..d2d8467977 100644 --- a/gfx/drivers/gl_common.h +++ b/gfx/drivers/gl_common.h @@ -366,13 +366,12 @@ typedef struct gl static INLINE void context_bind_hw_render(gl_t *gl, bool enable) { - driver_t *driver = driver_get_ptr(); - const gfx_ctx_driver_t *ctx_driver = driver ? (const gfx_ctx_driver_t*)driver->video_context : NULL; + const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr(); if (!gl) return; - if (gl->shared_context_use && ctx_driver->bind_hw_render) - ctx_driver->bind_hw_render(gl, enable); + if (gl->shared_context_use && ctx->bind_hw_render) + ctx->bind_hw_render(gl, enable); } static INLINE bool gl_check_error(void)