jtg | afb833d | 1999-08-19 00:55:39 +0000 | [diff] [blame^] | 1 | /* 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 | |
| 18 | GLboolean 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 | } |