medfall

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

commit eb22bb81fbae3e775cfd492510e028c9ed0c9e71
parent 4c1cc15a288970c3987576aa75a4e42b3f3ec745
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Thu Dec 29 14:00:13 +0200

Don't use debug output on NVIDIA + Windows

Diffstat:
gl.cc | 16++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/gl.cc b/gl.cc @@ -134,12 +134,23 @@ GLFWwindow * gl_init() { { "EXT_texture_compression_rgtc", GLAD_GL_EXT_texture_compression_rgtc } }; + const char * vendor = ( const char * ) glGetString( GL_VENDOR ); + INFO( "Version %s", glGetString( GL_VERSION ) ); + INFO( "Vendor %s", vendor ); + INFO( "OpenGL extensions:" ); for( size_t i = 0; i < ARRAY_COUNT( exts ); i++ ) { INFO( "%s: %s", exts[ i ].name, exts[ i ].enabled == 0 ? "missing" : "present" ); } - if( GLAD_GL_KHR_debug != 0 ) { + bool nvidia_and_windows = false; +#ifdef PLATFORM_WINDOWS + if( strstr( vendor, "NVIDIA" ) ) { + nvidia_and_windows = true; + } +#endif + + if( GLAD_GL_KHR_debug != 0 && !nvidia_and_windows ) { GLint context_flags; glGetIntegerv( GL_CONTEXT_FLAGS, &context_flags ); if( context_flags & GL_CONTEXT_FLAG_DEBUG_BIT ) { @@ -158,9 +169,6 @@ GLFWwindow * gl_init() { glDebugMessageEnableAMD( 0, 0, 0, NULL, GL_TRUE ); } - INFO( "Version %s", glGetString( GL_VERSION ) ); - INFO( "Vendor %s", glGetString( GL_VENDOR ) ); - glEnable( GL_DEPTH_TEST ); glDepthFunc( GL_LESS );