diff --git a/gfx/common/egl_common.c b/gfx/common/egl_common.c index 2c24b072cb..9468182937 100644 --- a/gfx/common/egl_common.c +++ b/gfx/common/egl_common.c @@ -279,8 +279,8 @@ void egl_destroy(egl_ctx_data_t *egl) #if !defined(RARCH_MOBILE) if (egl->ctx != EGL_NO_CONTEXT) { - glFlush(); - glFinish(); + gl_flush(); + gl_finish(); } #endif #endif diff --git a/gfx/common/gl_common.c b/gfx/common/gl_common.c index be0d96cb4c..55a526207c 100644 --- a/gfx/common/gl_common.c +++ b/gfx/common/gl_common.c @@ -17,6 +17,11 @@ #include +void gl_flush(void) +{ + glFlush(); +} + void gl_clear(void) { glClear(GL_COLOR_BUFFER_BIT); diff --git a/gfx/common/gl_common.h b/gfx/common/gl_common.h index c62f520fc2..e7cb29600c 100644 --- a/gfx/common/gl_common.h +++ b/gfx/common/gl_common.h @@ -25,4 +25,6 @@ void gl_disable(unsigned cap); void gl_finish(void); +void gl_flush(void); + #endif diff --git a/gfx/drivers_context/drm_ctx.c b/gfx/drivers_context/drm_ctx.c index 433bbc13c8..a8268cf964 100644 --- a/gfx/drivers_context/drm_ctx.c +++ b/gfx/drivers_context/drm_ctx.c @@ -37,6 +37,10 @@ #include #include +#ifdef HAVE_CONFIG_H +#include "../../config.h" +#endif + #include "../../configuration.h" #include "../../verbosity.h" #include "../../frontend/frontend_driver.h" @@ -46,9 +50,7 @@ #include "../common/egl_common.h" #endif -#ifdef HAVE_CONFIG_H -#include "../../config.h" -#endif +#include "../common/gl_common.h" #ifdef HAVE_OPENGLES diff --git a/gfx/drivers_context/ps3_ctx.c b/gfx/drivers_context/ps3_ctx.c index 0293e32568..4a24b0eb18 100644 --- a/gfx/drivers_context/ps3_ctx.c +++ b/gfx/drivers_context/ps3_ctx.c @@ -29,7 +29,7 @@ #include "../../verbosity.h" #include #include "../../frontend/frontend_driver.h" -/* TODO/FIXME - we should have a gl_common.h for functions like glFinish so we don't have to include gl2_common.h here */ +#include "../common/gl_common.h" #include "../common/gl2_common.h" typedef struct gfx_ctx_ps3_data