Skip to content

Instantly share code, notes, and snippets.

@ewencp
Created February 3, 2009 02:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ewencp/57246 to your computer and use it in GitHub Desktop.
Save ewencp/57246 to your computer and use it in GitHub Desktop.
// check for GL errors and print them to stderr
inline void glError(const char* location)
{
GLenum e;
e = glGetError();
if (e != GL_NO_ERROR)
{
fprintf (stderr, "ERROR!!! %s, %s\n", location, gluErrorString(e));
e = glGetError();
while (e != GL_NO_ERROR)
{
fprintf (stderr, "ERROR!!! %s, %s\n", location, gluErrorString(e));
e = glGetError();
}
}
// only uncomment this if you are super paranoid
//else fprintf (stderr, "no error %s\n", location);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment