Created
March 24, 2016 09:21
-
-
Save Robadob/a9de4ff440dca6943268 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
#ifdef _DEBUG //VS standard debug flag | |
inline static void HandleGLError(const char *file, int line) { | |
GLuint error = glGetError(); | |
if (error != GL_NO_ERROR) | |
{ | |
printf("%s(%i) GL Error Occurred;\n%s\n", file, line, gluErrorString(error)); | |
#if EXIT_ON_ERROR | |
getchar(); | |
exit(1); | |
#endif | |
} | |
} | |
#define GL_CALL( err ) err ;HandleGLError(__FILE__, __LINE__) | |
#define GL_CHECK() (HandleGLError(__FILE__, __LINE__)) | |
#else //ifdef _DEBUG | |
//Remove the checks when running release mode. | |
#define GL_CALL( err ) err | |
#define GL_CHECK() | |
#endif //ifdef _DEBUG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment