Created
January 26, 2013 06:04
-
-
Save dpasca/4640485 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace DGLUT | |
{ | |
//================================================================== | |
void CheckGLErr( const char *pFileName, int line ) | |
{ | |
GLenum err = glGetError(); | |
while (err != GL_NO_ERROR) | |
{ | |
const char *pErr = NULL; | |
switch (err) | |
{ | |
case GL_NO_ERROR: pErr = "GL_NO_ERROR"; break; | |
case GL_INVALID_ENUM: pErr = "GL_INVALID_ENUM"; break; | |
case GL_INVALID_VALUE: pErr = "GL_INVALID_VALUE"; break; | |
case GL_INVALID_OPERATION: pErr = "GL_INVALID_OPERATION"; break; | |
case GL_OUT_OF_MEMORY: pErr = "GL_OUT_OF_MEMORY"; break; | |
default: | |
break; | |
} | |
if ( pErr ){ | |
DPRINT( "GL error: %s at %s : %i", pErr, pFileName, line ); | |
} else { | |
DPRINT( "Unknown error: %d 0x%x at %s : %i", err, err, pFileName, line ); | |
} | |
//DASSERT( 0 ); | |
err = glGetError(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace DGLUT | |
{ | |
void CheckGLErr( const char *pFileName, int line ); | |
} | |
//================================================================== | |
#if defined(DEBUG) || defined(_DEBUG) | |
# define CHECKGLERR DGLUT::CheckGLErr(__FILE__,__LINE__) | |
#else | |
# define CHECKGLERR | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment