summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-04-08 01:21:55 +0300
committerAndrei Karas <akaras@inbox.ru>2014-04-08 01:21:55 +0300
commit8781220335a1f7b8b60122df13fedba23bef9b35 (patch)
tree89785ca78b67731683e76e4ad6de62078e54c74e /src/render
parentcf24722d84c7e4fd1d32365d720c291a48b9f9c8 (diff)
downloadplus-8781220335a1f7b8b60122df13fedba23bef9b35.tar.gz
plus-8781220335a1f7b8b60122df13fedba23bef9b35.tar.bz2
plus-8781220335a1f7b8b60122df13fedba23bef9b35.tar.xz
plus-8781220335a1f7b8b60122df13fedba23bef9b35.zip
Add support for OpenGL extension GL_EXT_debug_marker.
Diffstat (limited to 'src/render')
-rw-r--r--src/render/mgl.cpp3
-rw-r--r--src/render/mgl.h8
-rw-r--r--src/render/opengldebug.h36
3 files changed, 47 insertions, 0 deletions
diff --git a/src/render/mgl.cpp b/src/render/mgl.cpp
index ff51c659d..bf8483a67 100644
--- a/src/render/mgl.cpp
+++ b/src/render/mgl.cpp
@@ -45,6 +45,9 @@ defName(glDebugMessageCallback);
defName(glFrameTerminator);
defName(glLabelObject);
defName(glGetObjectLabel);
+defName(glInsertEventMarker);
+defName(glPushGroupMarker);
+defName(glPopGroupMarker);
#ifdef WIN32
defName(wglGetExtensionsString);
diff --git a/src/render/mgl.h b/src/render/mgl.h
index 8fc98f8fe..b612c5e03 100644
--- a/src/render/mgl.h
+++ b/src/render/mgl.h
@@ -113,6 +113,11 @@ typedef void (APIENTRY *glLabelObject_t) (GLenum type, GLuint object,
GLsizei length, const GLchar *label);
typedef void (APIENTRY *glGetObjectLabel_t) (GLenum type, GLuint object,
GLsizei bufSize, GLsizei *length, GLchar *label);
+typedef void (APIENTRY *glInsertEventMarker_t)
+ (GLsizei length, const char *marker);
+typedef void (APIENTRY *glPushGroupMarker_t)
+ (GLsizei length, const char *marker);
+typedef void (APIENTRY *glPopGroupMarker_t) (void);
// callback
typedef void (APIENTRY *GLDEBUGPROC_t) (GLenum source, GLenum type, GLuint id,
@@ -140,6 +145,9 @@ defNameE(glDebugMessageCallback);
defNameE(glFrameTerminator);
defNameE(glLabelObject);
defNameE(glGetObjectLabel);
+defNameE(glInsertEventMarker);
+defNameE(glPushGroupMarker);
+defNameE(glPopGroupMarker);
#ifdef WIN32
typedef const char* (APIENTRY * wglGetExtensionsString_t) (HDC hdc);
diff --git a/src/render/opengldebug.h b/src/render/opengldebug.h
new file mode 100644
index 000000000..82b151cc8
--- /dev/null
+++ b/src/render/opengldebug.h
@@ -0,0 +1,36 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2014 The ManaPlus Developers
+ *
+ * This file is part of The ManaPlus Client.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef RENDER_OPENGLDEBUG_H
+#define RENDER_OPENGLDEBUG_H
+
+#include "render/mgl.h"
+
+#if defined(DEBUG_OPENGL) && defined(USE_OPENGL)
+#define GLDEBUG_START(text) if (mglPushGroupMarker) \
+ mglPushGroupMarker(sizeof(text), text);
+#define GLDEBUG_END() if (mglPopGroupMarker) \
+ mglPopGroupMarker();
+#else
+#define GLDEBUG_START(text)
+#define GLDEBUG_END()
+#endif
+
+#endif // RENDER_OPENGLDEBUG_H