aboutsummaryrefslogtreecommitdiff
path: root/progs/util/errcheck.c
diff options
context:
space:
mode:
authorRadosław Kujawa <radoslaw.kujawa@c0ff33.net>2026-07-17 14:54:32 +0200
committerRadosław Kujawa <radoslaw.kujawa@c0ff33.net>2026-07-17 14:54:32 +0200
commit2702c90d7a39fca2a3319c5e915fd290cb31fc70 (patch)
tree283c4d851efef7e3a7cd03ba80c87e2bffcdbb2c /progs/util/errcheck.c
parent836167945ec2c7ad5acdf0aa17ce35ec1b9428a6 (diff)
Initial import.
Diffstat (limited to 'progs/util/errcheck.c')
-rw-r--r--progs/util/errcheck.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/progs/util/errcheck.c b/progs/util/errcheck.c
new file mode 100644
index 0000000..fe9c297
--- /dev/null
+++ b/progs/util/errcheck.c
@@ -0,0 +1,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;
+}