projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Precalculated renderer specific surface data, better management of multiple renderers...
[supertux.git]
/
src
/
video
/
glutil.hpp
diff --git
a/src/video/glutil.hpp
b/src/video/glutil.hpp
index
be09ba4
..
b19ce8b
100644
(file)
--- a/
src/video/glutil.hpp
+++ b/
src/video/glutil.hpp
@@
-1,7
+1,7
@@
// $Id$
//
// $Id$
//
-// SuperTux
- A Jump'n Run
-// Copyright (C) 200
4 Matthias Braun <matze@braunis.de
+// SuperTux
+// Copyright (C) 200
6 Matthias Braun <matze@braunis.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@
-19,11
+19,16
@@
#ifndef __GLUTIL_HPP__
#define __GLUTIL_HPP__
#ifndef __GLUTIL_HPP__
#define __GLUTIL_HPP__
+#include <config.h>
+
+#ifdef HAVE_OPENGL
+
#include <sstream>
#include <stdexcept>
#include <GL/gl.h>
#include <sstream>
#include <stdexcept>
#include <GL/gl.h>
+#include <GL/glext.h>
-static inline void
assert_gl
(const char* message)
+static inline void
check_gl_error
(const char* message)
{
#ifdef DEBUG
GLenum error = glGetError();
{
#ifdef DEBUG
GLenum error = glGetError();
@@
-52,14
+57,40
@@
static inline void assert_gl(const char* message)
msg << "OUT_OF_MEMORY: There is not enough memory left to execute the "
"command.";
break;
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 << ")";
}
default:
msg << "Unknown error (code " << error << ")";
}
-
+
throw std::runtime_error(msg.str());
}
throw std::runtime_error(msg.str());
}
+#else
+ (void) message;
#endif
}
#endif
}
+static inline void assert_gl(const char* message)
+{
+#ifdef DEBUG
+ check_gl_error(message);
+#else
+ (void) 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