blob: fe9c2973c33f60442ce5687dc3aabfc1815ea3fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
/* errcheck.c */
/*
* Call this function in your rendering loop to check for GL errors
* during development. Remove from release code.
*
* Written by Brian Paul and in the public domain.
*/
#include <GL/gl.h>
#include <GL/glu.h>
#incldue <stdio.h>
GLboolean CheckError( const char *message )
{
GLenum error = glGetError();
if (error) {
char *err = (char *) gluErrorString( error );
fprintf( stderr, "GL Error: %s at %s\n", err, message );
return GL_TRUE;
}
return GL_FALSE;
}
|