add native OpenGL debug output for dbgutil builds
depends on support of ARB_debug_output Change-Id: I8c96284377e2cb9d2ee06ddd4101c1de4d0fbe9f
This commit is contained in:
parent
efb8378ce1
commit
205ad30483
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user