diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index ad6832d86f..f8a44ba6cb 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -1774,6 +1774,10 @@ void OPENGL_GAL::init() GLenum err = glewInit(); +#ifdef __WXDEBUG__ + enableGlDebug( true ); +#endif + try { if( GLEW_OK != err ) diff --git a/common/gal/opengl/utils.cpp b/common/gal/opengl/utils.cpp index 06af84546e..64faeec788 100644 --- a/common/gal/opengl/utils.cpp +++ b/common/gal/opengl/utils.cpp @@ -88,7 +88,15 @@ int checkGlError( const std::string& aInfo, bool aThrow ) static void GLAPIENTRY debugMsgCallback( GLenum aSource, GLenum aType, GLuint aId, GLenum aSeverity, GLsizei aLength, const GLchar* aMessage, const void* aUserParam ) { - printf( "%s", aMessage ); + switch( aSeverity ) + { + case GL_DEBUG_SEVERITY_HIGH: printf( "OpenGL ERROR: " ); break; + case GL_DEBUG_SEVERITY_MEDIUM: printf( "OpenGL WARNING: " ); break; + case GL_DEBUG_SEVERITY_LOW: printf( "OpenGL INFO: " ); break; + case GL_DEBUG_SEVERITY_NOTIFICATION: return; + } + + printf( "%s\n", aMessage ); }