Kaydet (Commit) 205ad304 authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Markus Mohrhard

add native OpenGL debug output for dbgutil builds

depends on support of ARB_debug_output

Change-Id: I8c96284377e2cb9d2ee06ddd4101c1de4d0fbe9f
üst efb8378c
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment