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