projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
replace some of the glBegin,glEnd calls with glDrawArrays
[supertux.git]
/
src
/
video
/
glutil.hpp
diff --git
a/src/video/glutil.hpp
b/src/video/glutil.hpp
index
0ccb630
..
85200bd
100644
(file)
--- a/
src/video/glutil.hpp
+++ b/
src/video/glutil.hpp
@@
-19,9
+19,20
@@
#ifndef __GLUTIL_HPP__
#define __GLUTIL_HPP__
#ifndef __GLUTIL_HPP__
#define __GLUTIL_HPP__
+#include <config.h>
+
+#ifdef HAVE_OPENGL
+
#include <sstream>
#include <stdexcept>
#include <sstream>
#include <stdexcept>
+
+#ifndef MACOSX
#include <GL/gl.h>
#include <GL/gl.h>
+#include <GL/glext.h>
+#else
+#include <OpenGL/gl.h>
+#include <OpenGL/glext.h>
+#endif
static inline void check_gl_error(const char* message)
{
static inline void check_gl_error(const char* message)
{
@@
-56,13
+67,15
@@
static inline void check_gl_error(const char* message)
case GL_TABLE_TOO_LARGE:
msg << "TABLE_TOO_LARGE: table is too large";
break;
case GL_TABLE_TOO_LARGE:
msg << "TABLE_TOO_LARGE: table is too large";
break;
-#endif
+#endif
default:
msg << "Unknown error (code " << error << ")";
}
default:
msg << "Unknown error (code " << error << ")";
}
-
+
throw std::runtime_error(msg.str());
}
throw std::runtime_error(msg.str());
}
+#else
+ (void) message;
#endif
}
#endif
}
@@
-75,4
+88,15
@@
static inline void assert_gl(const char* message)
#endif
}
#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
#endif