// $Id$
//
-// SuperTux - A Jump'n Run
-// Copyright (C) 2004 Matthias Braun <matze@braunis.de
+// SuperTux
+// Copyright (C) 2006 Matthias Braun <matze@braunis.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
#include <stdexcept>
#include <GL/gl.h>
-static inline void assert_gl(const char* message)
+static inline void check_gl_error(const char* message)
{
#ifdef DEBUG
GLenum error = glGetError();
msg << "OUT_OF_MEMORY: There is not enough memory left to execute the "
"command.";
break;
+#ifdef GL_TABLE_TOO_LARGE
case GL_TABLE_TOO_LARGE:
- msg << "TABLE_TOO_LARGE: The specified table exceeds the "
- "implementation's maximum supported table size.";
+ msg << "TABLE_TOO_LARGE: table is too large";
break;
+#endif
default:
msg << "Unknown error (code " << error << ")";
}
-
+
throw std::runtime_error(msg.str());
}
#endif
}
+static inline void assert_gl(const char* message)
+{
+#ifdef DEBUG
+ check_gl_error(message);
+#else
+ (void) message;
#endif
+}
+#endif