X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fvideo%2Fglutil.hpp;h=85200bdd6323bcfc0966fe778321a66b77096acb;hb=38105c22495d9439b30221732dd5d7b89f328a0c;hp=54db311259b7ad7ad56f5a56f97d16d94dd3e778;hpb=07ddaed2a657e4d2a3d038fed223fc5827159caf;p=supertux.git diff --git a/src/video/glutil.hpp b/src/video/glutil.hpp index 54db31125..85200bdd6 100644 --- a/src/video/glutil.hpp +++ b/src/video/glutil.hpp @@ -16,15 +16,25 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - #ifndef __GLUTIL_HPP__ #define __GLUTIL_HPP__ +#include + +#ifdef HAVE_OPENGL + #include #include + +#ifndef MACOSX #include +#include +#else +#include +#include +#endif -static inline void assert_gl(const char* message) +static inline void check_gl_error(const char* message) { #ifdef DEBUG GLenum error = glGetError(); @@ -53,14 +63,40 @@ 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()); } +#else + (void) message; #endif } +static inline void assert_gl(const char* message) +{ +#ifdef DEBUG + check_gl_error(message); +#else + (void) message; #endif +} + +#else +#define GLenum int +#define GLint int +#define GL_SRC_ALPHA 0 +#define GL_ONE_MINUS_SRC_ALPHA 1 +#define GL_RGBA 2 +#define GL_ONE 3 + +#endif + +#endif