X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fvideo%2Fglutil.hpp;h=6c2122fe0400e6f9d2837008b923b0e95f39cbde;hb=4a486d92343d1824b311c234e9321e08f280fe68;hp=be09ba46e802ace3ce55844f099bd582635a6d5b;hpb=551c54f2ea0a4ef991a24e66e70635ed8c41fb10;p=supertux.git diff --git a/src/video/glutil.hpp b/src/video/glutil.hpp index be09ba46e..6c2122fe0 100644 --- a/src/video/glutil.hpp +++ b/src/video/glutil.hpp @@ -1,7 +1,7 @@ // $Id$ // -// SuperTux - A Jump'n Run -// Copyright (C) 2004 Matthias Braun // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -23,7 +23,7 @@ #include #include -static inline void assert_gl(const char* message) +static inline void check_gl_error(const char* message) { #ifdef DEBUG GLenum error = glGetError(); @@ -52,14 +52,27 @@ static inline void assert_gl(const char* message) 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: 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