OpenGL driver debug routines
This commit is contained in:
parent
2d9ab80b4e
commit
46b5575c51
|
@ -340,6 +340,8 @@ void OPENGL_GAL::BeginDrawing()
|
|||
wxLogTrace( "GAL_PROFILE",
|
||||
wxT( "OPENGL_GAL::BeginDrawing(): %.1f ms" ), totalRealTime.msecs() );
|
||||
#endif /* __WXDEBUG__ */
|
||||
|
||||
//enableGlDebug( true );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -82,3 +82,23 @@ int checkGlError( const std::string& aInfo, bool aThrow )
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
static void debugMsgCallback( GLenum aSource, GLenum aType, GLuint aId,
|
||||
GLenum aSeverity, GLsizei aLength, const GLchar* aMessage, const void* aUserParam)
|
||||
{
|
||||
printf( "%s", aMessage );
|
||||
}
|
||||
|
||||
|
||||
void enableGlDebug( bool aEnable )
|
||||
{
|
||||
if( aEnable )
|
||||
{
|
||||
glEnable( GL_DEBUG_OUTPUT );
|
||||
glDebugMessageCallback( debugMsgCallback, nullptr );
|
||||
}
|
||||
else
|
||||
{
|
||||
glDisable( GL_DEBUG_OUTPUT );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,4 +36,10 @@
|
|||
*/
|
||||
int checkGlError( const std::string& aInfo, bool aThrow = true );
|
||||
|
||||
/**
|
||||
* @brief Enables/disables OpenGL driver messages output.
|
||||
* @param aEnable decides whether the message should be shown.
|
||||
*/
|
||||
void enableGlDebug( bool aEnable );
|
||||
|
||||
#endif /* __OPENGL_ERROR_H */
|
||||
|
|
Loading…
Reference in New Issue