summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-04-07 12:01:47 +0300
committerAndrei Karas <akaras@inbox.ru>2014-04-07 12:15:23 +0300
commite786bcdc61657e4b2e2cae4bf6f44bb70a14587a (patch)
tree34d0e4e72d185e44ed56ab1ae81cbee29ca5e83b /src/render
parentf73819c8e075b0925381052590a5ac9ec6ac1b68 (diff)
downloadplus-e786bcdc61657e4b2e2cae4bf6f44bb70a14587a.tar.gz
plus-e786bcdc61657e4b2e2cae4bf6f44bb70a14587a.tar.bz2
plus-e786bcdc61657e4b2e2cae4bf6f44bb70a14587a.tar.xz
plus-e786bcdc61657e4b2e2cae4bf6f44bb70a14587a.zip
Add support for OpenGL extension GL_GREMEDY_frame_terminator.
It allow show to debugger where is frame termination.
Diffstat (limited to 'src/render')
-rw-r--r--src/render/mgl.cpp1
-rw-r--r--src/render/mgl.h2
-rw-r--r--src/render/mobileopenglgraphics.cpp6
-rw-r--r--src/render/normalopenglgraphics.cpp6
-rw-r--r--src/render/safeopenglgraphics.cpp6
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")
}