X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fvideo%2Fglutil.hpp;h=4ead32d6266f9c31d456256fbac575a502a1e7bc;hb=6492679a300bff2c17505c5d9bc9d333eeba384d;hp=6c2122fe0400e6f9d2837008b923b0e95f39cbde;hpb=a113d3bd1feddd510e3b2852b0d42522735eee40;p=supertux.git diff --git a/src/video/glutil.hpp b/src/video/glutil.hpp index 6c2122fe0..4ead32d62 100644 --- a/src/video/glutil.hpp +++ b/src/video/glutil.hpp @@ -1,12 +1,10 @@ -// $Id$ -// // SuperTux // Copyright (C) 2006 Matthias Braun // -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,18 +12,45 @@ // GNU General Public License for more details. // // 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__ +// along with this program. If not, see . + +#ifndef HEADER_SUPERTUX_VIDEO_GLUTIL_HPP +#define HEADER_SUPERTUX_VIDEO_GLUTIL_HPP + +#include + +#ifdef HAVE_OPENGL #include #include -#include + + +#ifdef USE_GLBINDING + +#include +using namespace gl; + +#else + +#ifndef GL_VERSION_ES_CM_1_0 +# include +#endif + +#if defined(MACOSX) +# include +# include +#elif defined(GL_VERSION_ES_CM_1_0) +# include +# include +#else +# include +# include +#endif + +#endif static inline void check_gl_error(const char* message) { -#ifdef DEBUG GLenum error = glGetError(); if(error != GL_NO_ERROR) { std::ostringstream msg; @@ -33,14 +58,14 @@ static inline void check_gl_error(const char* message) switch(error) { case GL_INVALID_ENUM: msg << "INVALID_ENUM: An unacceptable value is specified for an " - "enumerated argument."; + "enumerated argument."; break; case GL_INVALID_VALUE: msg << "INVALID_VALUE: A numeric argument is out of range."; break; case GL_INVALID_OPERATION: msg << "INVALID_OPERATION: The specified operation is not allowed " - "in the current state."; + "in the current state."; break; case GL_STACK_OVERFLOW: msg << "STACK_OVERFLOW: This command would cause a stack overflow."; @@ -50,7 +75,7 @@ static inline void check_gl_error(const char* message) break; case GL_OUT_OF_MEMORY: msg << "OUT_OF_MEMORY: There is not enough memory left to execute the " - "command."; + "command."; break; #ifdef GL_TABLE_TOO_LARGE case GL_TABLE_TOO_LARGE: @@ -63,16 +88,24 @@ static inline void check_gl_error(const char* message) throw std::runtime_error(msg.str()); } -#endif } static inline void assert_gl(const char* message) { -#ifdef DEBUG check_gl_error(message); +} + #else - (void) message; + +#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 + +/* EOF */