29 files changed, 1185 insertions, 0 deletions
diff --git a/src/util/check_error.c b/src/util/check_error.c new file mode 100644 index 0000000..dbe5b8f --- a/dev/null +++ b/src/util/check_error.c | |||
@@ -0,0 +1,17 @@ | |||
1 | #include <GL/glut.h> | ||
2 | #include <error.h> | ||
3 | #include <errno.h> | ||
4 | |||
5 | void | ||
6 | check_error (const char *filename, unsigned int linenum) | ||
7 | { | ||
8 | GLenum errCode = glGetError (); | ||
9 | if (errCode != GL_NO_ERROR) | ||
10 | { | ||
11 | const GLubyte *errString = gluErrorString (errCode); | ||
12 | error_at_line (-1, errno, filename, linenum, | ||
13 | "OpenGL Error %s", errString); | ||
14 | } | ||
15 | |||
16 | return; | ||
17 | } | ||