Last active
December 15, 2015 21:19
-
-
Save vinjn/5325366 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#ifdef _DEBUG | |
static void CheckGLError(const char *file, int line, const char *func) | |
{ | |
int err=0; | |
char msg[256]; | |
while( (err=_glGetError())!=0 ) | |
{ | |
sprintf(msg, "%s(%d) : [%s] GL_ERROR=0x%x\n", file, line, func, err); | |
#ifdef WIN32 | |
OutputDebugStringA(msg); | |
#endif | |
fprintf(stderr, msg); | |
} | |
} | |
# ifdef __FUNCTION__ | |
# define CHECK_GL_ERROR CheckGLError(__FILE__, __LINE__, __FUNCTION__) | |
# else | |
# define CHECK_GL_ERROR CheckGLError(__FILE__, __LINE__, "") | |
# endif | |
#else | |
# define CHECK_GL_ERROR ((void)(0)) | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment