Implement debug callback

This commit is contained in:
Leith Bade
2014-12-02 01:53:44 +11:00
parent bbfe5d5ce4
commit 2113e27990
2 changed files with 48 additions and 3 deletions

View File

@@ -42,6 +42,16 @@ void Painter::setup() {
#if defined(DEBUG)
util::stopwatch stopwatch("painter setup");
#endif
// Enable GL debugging
if ((gl::DebugMessageControl != nullptr) && (gl::DebugMessageCallback != nullptr)) {
// This will enable all messages including performance hints
//gl::DebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, GL_TRUE);
gl::DebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_HIGH, 0, nullptr, GL_TRUE);
gl::DebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_MEDIUM, 0, nullptr, GL_TRUE);
gl::DebugMessageCallback(gl::debug_callback, nullptr);
}
setupShaders();
assert(iconShader);