Add GFX_CTL_BIND_HW_RENDER

This commit is contained in:
twinaphex 2016-02-13 18:36:23 +01:00
parent b7c41c9fcd
commit 00e4793bed
3 changed files with 11 additions and 11 deletions

View File

@ -114,7 +114,7 @@ static const GLfloat white_color[] = {
static INLINE void context_bind_hw_render(gl_t *gl, bool enable) static INLINE void context_bind_hw_render(gl_t *gl, bool enable)
{ {
if (gl && gl->shared_context_use) 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) static INLINE bool gl_query_extension(gl_t *gl, const char *ext)

View File

@ -118,13 +118,6 @@ bool gfx_ctx_get_video_output_next(void)
return true; 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( bool gfx_ctx_set_video_mode(
unsigned width, unsigned height, unsigned width, unsigned height,
bool fullscreen) bool fullscreen)
@ -394,6 +387,14 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data)
{ {
switch (state) 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: case GFX_CTL_SET:
if (!data) if (!data)
return false; return false;

View File

@ -61,7 +61,8 @@ enum gfx_ctx_ctl_state
GFX_CTL_HAS_WINDOWED, GFX_CTL_HAS_WINDOWED,
GFX_CTL_UPDATE_WINDOW_TITLE, GFX_CTL_UPDATE_WINDOW_TITLE,
GFX_CTL_SHOW_MOUSE, GFX_CTL_SHOW_MOUSE,
GFX_CTL_SET GFX_CTL_SET,
GFX_CTL_BIND_HW_RENDER
}; };
typedef void (*gfx_ctx_proc_t)(void); 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_swap_interval(unsigned interval);
void gfx_ctx_bind_hw_render(bool enable);
void gfx_ctx_get_video_output_size(unsigned *width, unsigned *height); void gfx_ctx_get_video_output_size(unsigned *width, unsigned *height);
bool gfx_ctx_get_video_output_prev(void); bool gfx_ctx_get_video_output_prev(void);