Created
November 25, 2012 19:42
-
-
Save datenwolf/4144988 to your computer and use it in GitHub Desktop.
GLT (OpenGL Tools) multierror printer
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
#include <stdio.h> | |
#include <GL/gl.h> | |
#include <GLT/multierror.h> | |
void gltPrintMultiError(char const * const prefix) | |
{ | |
GLenum err; | |
while( (err = glGetError()) != GL_NO_ERROR) { | |
switch( err ) { | |
case GL_INVALID_ENUM: fprintf(stderr, "%s - OpenGL error: Invalid enum\n", prefix); break; | |
case GL_INVALID_VALUE: fprintf(stderr, "%s - OpenGL error: Invalid value\n", prefix); break; | |
case GL_INVALID_OPERATION: fprintf(stderr, "%s - OpenGL error: Invalid operation\n", prefix); break; | |
case GL_STACK_OVERFLOW: fprintf(stderr, "%s - OpenGL error: Invalid overflow\n", prefix); break; | |
case GL_STACK_UNDERFLOW: fprintf(stderr, "%s - OpenGL error: Invalid underflow\n", prefix); break; | |
case GL_OUT_OF_MEMORY: fprintf(stderr, "%s - OpenGL error: Invalid memory\n", prefix); break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment