Skip to content
Snippets Groups Projects
Commit 0669c26b authored by Janis Born's avatar Janis Born
Browse files

slightly better formatting of debug output in ACGL_KHR_default_debug_callback

parent c2766df6
Branches
No related tags found
No related merge requests found
......@@ -24,8 +24,8 @@ const char *debugSourceName( GLenum _source )
if (_source == GL_DEBUG_SOURCE_SHADER_COMPILER) return "Shader Compiler";
if (_source == GL_DEBUG_SOURCE_THIRD_PARTY) return "Third Party";
if (_source == GL_DEBUG_SOURCE_APPLICATION) return "Application";
if (_source == GL_DEBUG_SOURCE_OTHER) return "Other";
return "unknown";
if (_source == GL_DEBUG_SOURCE_OTHER) return "Unknown";
return "Unknown";
}
const char *debugTypeName( GLenum _type )
......@@ -33,11 +33,11 @@ const char *debugTypeName( GLenum _type )
if (_type == GL_DEBUG_TYPE_ERROR) return "Error";
if (_type == GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR) return "Deprecated Behavior";
if (_type == GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR) return "Undefined Behavior";
if (_type == GL_DEBUG_TYPE_PORTABILITY) return "Portability";
if (_type == GL_DEBUG_TYPE_PERFORMANCE) return "Performance";
if (_type == GL_DEBUG_TYPE_OTHER) return "Other";
if (_type == GL_DEBUG_TYPE_PORTABILITY) return "Portability Issue";
if (_type == GL_DEBUG_TYPE_PERFORMANCE) return "Performance Issue";
if (_type == GL_DEBUG_TYPE_MARKER) return "Marker";
return "unknown";
if (_type == GL_DEBUG_TYPE_OTHER) return "Issue";
return "Issue";
}
const char *debugSeverityName( GLenum _type )
......@@ -67,11 +67,10 @@ void ACGLRegisterDefaultDebugCallback()
//! place a brakepoint in here to find the source of a problem!
void ACGL_KHR_default_debug_callback( GLenum _source, GLenum _type, GLuint _id, GLenum _severity, GLsizei _length, const GLchar *_message, const void *_userParam)
{
if (_type == GL_DEBUG_TYPE_ERROR) {
error() << "<" << _id << "> severity: " << debugSeverityName(_severity) << " source: " << debugSourceName(_source) << ": " << _message << endl;
} else {
debug() << "<" << _id << "> severity: " << debugSeverityName(_severity) << " source: " << debugSourceName(_source) << ": " << _message << endl;
}
ostream& stream = (_type == GL_DEBUG_TYPE_ERROR) ? static_cast<ostream&>(error()) : static_cast<ostream&>(debug());
stream << debugSourceName(_source) << " " << debugTypeName(_type) << ": " << _message << " (id: " << _id << ", severity: " << debugSeverityName(_severity) << ")" << endl;
// delete all errors to not create another error log for the same problem:
while ( glGetError() != GL_NO_ERROR ) {}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment