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);