summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-02-13 04:39:21 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-02-13 23:16:41 +0100
commit205ad30483fdb0d7ef24f4fedf4a85cfe0edd2ce (patch)
treee1dd020796efbf01c79c2cd0d60cac7ec9ca9eef /chart2
parentefb8378ce1694091fbe46a002b82d2a9e0947d67 (diff)
add native OpenGL debug output for dbgutil builds
depends on support of ARB_debug_output Change-Id: I8c96284377e2cb9d2ee06ddd4101c1de4d0fbe9f
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/main/DummyXShape.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index d9c1a90dffe8..b8f40180b1d6 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -1140,6 +1140,21 @@ int oglErrorHandler( Display* /*dpy*/, XErrorEvent* /*evnt*/ )
#endif
+#if DBG_UTIL
+
+namespace {
+
+void debug_callback(GLenum source, GLenum type, GLuint id,
+ GLenum severity, GLsizei , const GLchar* message, void* )
+{
+ SAL_WARN("chart2.opengl", "OpenGL debug message: source: " << source << ", type: "
+ << type << ", id: " << id << ", severity: " << severity << " with message: " << message);
+}
+
+}
+
+#endif
+
bool DummyChart::initOpengl()
{
SAL_WARN("chart2.opengl", "DummyChart::initOpengl----start");
@@ -1253,6 +1268,16 @@ bool DummyChart::initOpengl()
m_GLRender.InitOpenGL(GLWin);
+#if DBG_UTIL
+ // only enable debug output in dbgutil build
+ if( GLEW_ARB_debug_output )
+ {
+ glEnable(GL_DEBUG_OUTPUT);
+ glDebugMessageCallback(&debug_callback, NULL);
+ }
+
+#endif
+
glEnable(GL_TEXTURE_2D);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);