medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit de07f381068874893ef595aa72363e9b0c515d02
parent 8643c35f18d2fccdef08e0841af7060c7b6d27e0
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun Dec 25 14:27:00 +0200

Check if GL_KHR_debug was actually loaded

Diffstat:
gl.cc | 18+++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/gl.cc b/gl.cc @@ -103,13 +103,17 @@ GLFWwindow * gl_init() { } #if PLATFORM_LINUX - GLint context_flags; - glGetIntegerv( GL_CONTEXT_FLAGS, &context_flags ); - if( context_flags & GL_CONTEXT_FLAG_DEBUG_BIT ) { - glEnable( GL_DEBUG_OUTPUT ); - glEnable( GL_DEBUG_OUTPUT_SYNCHRONOUS ); - glDebugMessageCallbackARB( ( GLDEBUGPROCARB ) gl_debug_output_callback, NULL ); - glDebugMessageControl( GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_TRUE ); + if( GLAD_GL_KHR_debug != 0 ) { + GLint context_flags; + glGetIntegerv( GL_CONTEXT_FLAGS, &context_flags ); + if( context_flags & GL_CONTEXT_FLAG_DEBUG_BIT ) { + INFO( "Initialising debug output" ); + + glEnable( GL_DEBUG_OUTPUT ); + glEnable( GL_DEBUG_OUTPUT_SYNCHRONOUS ); + glDebugMessageCallback( ( GLDEBUGPROC ) gl_debug_output_callback, NULL ); + glDebugMessageControl( GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_TRUE ); + } } #endif