switched to the flag used in other places
[supertux.git] / src / video / glutil.hpp
index 0ccb630..c1b45be 100644 (file)
 #ifndef __GLUTIL_HPP__
 #define __GLUTIL_HPP__
 
+#include <config.h>
+
+#ifdef HAVE_OPENGL
+
 #include <sstream>
 #include <stdexcept>
+
+#ifdef MACOSX
+#include <OpenGL/gl.h>
+#include <OpenGL/glext.h>
+#else
+#ifdef GL_VERSION_ES_CM_1_0
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+#else
 #include <GL/gl.h>
+#include <GL/glext.h>
+#endif
+#endif
 
 static inline void check_gl_error(const char* message)
 {
@@ -56,13 +72,15 @@ static inline void check_gl_error(const char* message)
       case GL_TABLE_TOO_LARGE:
         msg << "TABLE_TOO_LARGE: table is too large";
         break;
-#endif                        
+#endif
       default:
         msg << "Unknown error (code " << error << ")";
     }
-        
+
     throw std::runtime_error(msg.str());
   }
+#else
+  (void) message;
 #endif
 }
 
@@ -75,4 +93,15 @@ static inline void assert_gl(const char* 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