Created
October 24, 2012 14:04
-
-
Save preble/3946220 to your computer and use it in GitHub Desktop.
glGetError() test macro
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
// A macro I wrote a few years back to assist in checking OpenGL error codes. | |
// Add to a .h or at the top of your implementation file: | |
#define GLERR do {\ | |
GLuint glerr;\ | |
while((glerr = glGetError()) != GL_NO_ERROR)\ | |
fprintf(stderr, "%s:%d glGetError() = 0x%04x", __FILE__, __LINE__, glerr);\ | |
} while (0) | |
// Sprinkle in "GLERR;" after failure-prone OpenGL calls. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment