diff options
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/mgl.cpp | 1 | ||||
-rw-r--r-- | src/render/mgl.h | 2 | ||||
-rw-r--r-- | src/render/mobileopenglgraphics.cpp | 6 | ||||
-rw-r--r-- | src/render/normalopenglgraphics.cpp | 6 | ||||
-rw-r--r-- | src/render/safeopenglgraphics.cpp | 6 |
5 files changed, 21 insertions, 0 deletions
diff --git a/src/render/mgl.cpp b/src/render/mgl.cpp index 54845b944..bd67c2f0e 100644 --- a/src/render/mgl.cpp +++ b/src/render/mgl.cpp @@ -42,6 +42,7 @@ defName(glBindSampler); defName(glSamplerParameteri); defName(glDebugMessageControl); defName(glDebugMessageCallback); +defName(glFrameTerminator); #ifdef WIN32 defName(wglGetExtensionsString); diff --git a/src/render/mgl.h b/src/render/mgl.h index a47a70218..e2e710029 100644 --- a/src/render/mgl.h +++ b/src/render/mgl.h @@ -99,6 +99,7 @@ typedef void (APIENTRY *glSamplerParameteri_t) (GLuint sampler, GLenum pname, GLint param); typedef void (APIENTRY *glDebugMessageControl_t) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (APIENTRY *glFrameTerminator_t) (void); // callback typedef void (APIENTRY *GLDEBUGPROC_t) (GLenum source, GLenum type, GLuint id, @@ -123,6 +124,7 @@ defNameE(glBindSampler); defNameE(glSamplerParameteri); defNameE(glDebugMessageControl); defNameE(glDebugMessageCallback); +defNameE(glFrameTerminator); #ifdef WIN32 typedef const char* (APIENTRY * wglGetExtensionsString_t) (HDC hdc); diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index 0ad5bfeb7..ede89f115 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -31,6 +31,8 @@ #include "graphicsvertexes.h" #include "logger.h" +#include "render/mgl.h" + #include "resources/image.h" #include "resources/openglimagehelper.h" @@ -834,6 +836,10 @@ void MobileOpenGLGraphics::updateScreen() #else SDL_GL_SwapBuffers(); #endif +#ifdef DEBUG_OPENGL + if (mglFrameTerminator) + mglFrameTerminator(); +#endif // may be need clear? // glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); BLOCK_END("Graphics::updateScreen") diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index 72fbd8a99..8f3659936 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -30,6 +30,8 @@ #include "graphicsvertexes.h" #include "logger.h" +#include "render/mgl.h" + #include "resources/image.h" #include "resources/openglimagehelper.h" @@ -1095,6 +1097,10 @@ void NormalOpenGLGraphics::updateScreen() #else SDL_GL_SwapBuffers(); #endif +#ifdef DEBUG_OPENGL + if (mglFrameTerminator) + mglFrameTerminator(); +#endif // may be need clear? // glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); BLOCK_END("Graphics::updateScreen") diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp index a191142b5..177cfecb5 100644 --- a/src/render/safeopenglgraphics.cpp +++ b/src/render/safeopenglgraphics.cpp @@ -28,6 +28,8 @@ #include "configuration.h" #include "graphicsmanager.h" +#include "render/mgl.h" + #include "resources/image.h" #include "resources/openglimagehelper.h" @@ -421,6 +423,10 @@ void SafeOpenGLGraphics::updateScreen() #else SDL_GL_SwapBuffers(); #endif +#ifdef DEBUG_OPENGL + if (mglFrameTerminator) + mglFrameTerminator(); +#endif BLOCK_END("Graphics::updateScreen") } |