Enable OpenGL debug output in debug builds
This commit is contained in:
parent
6dbd7a8d73
commit
8a68a21570
|
@ -1774,6 +1774,10 @@ void OPENGL_GAL::init()
|
|||
|
||||
GLenum err = glewInit();
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
enableGlDebug( true );
|
||||
#endif
|
||||
|
||||
try
|
||||
{
|
||||
if( GLEW_OK != err )
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue