projects
/
gltest.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix build
[gltest.git]
/
glutil.cpp
diff --git
a/glutil.cpp
b/glutil.cpp
index 0da85d527472b31c7b64f2ab43163993760dc035..325c131733d9263aad025375541d3c8b9d7083e2 100644
(file)
--- a/
glutil.cpp
+++ b/
glutil.cpp
@@
-20,6
+20,16
@@
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
+#include <stdarg.h>
+
+void die(const char *msg, ...)
+{
+ va_list ap;
+ va_start(ap, msg);
+ vfprintf(stderr, msg, ap);
+ va_end(ap);
+ exit(1);
+}
static const char *glErrorToString(GLenum e)
{
static const char *glErrorToString(GLenum e)
{
@@
-43,6
+53,5
@@
void checkGlError(const char *what)
{
GLenum e = glGetError();
if (e == GL_NO_ERROR) return;
{
GLenum e = glGetError();
if (e == GL_NO_ERROR) return;
- fprintf(stderr, "GL error %d (%s): %s\n", e, glErrorToString(e), what);
- exit(1);
+ die("GL error %d (%s): %s\n", e, glErrorToString(e), what);
}
}