summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2002-12-09 08:45:30 +0000
committerpixel <pixel>2002-12-09 08:45:30 +0000
commit822bea0a87305675830b7038e138a1d2a988a904 (patch)
tree45069bbff9b7a8fdbd97d1ed04593dc59d489b3f
parent8125f1f4ee8215a4486acd514b1c96a2957fa809 (diff)
Bleh
-rw-r--r--include/glbase.h6
-rw-r--r--lib/glbase.cc30
2 files changed, 25 insertions, 11 deletions
diff --git a/include/glbase.h b/include/glbase.h
index 1852250..39c7493 100644
--- a/include/glbase.h
+++ b/include/glbase.h
@@ -16,10 +16,10 @@ namespace mogltk {
static void Leave2DMode(void);
static void Flip(void);
static bool is2D(void);
- static void glVertex(GLdouble, GLdouble, GLdouble = 0.0, GLdouble = 1.0);
- static void glVertex(GLfloat, GLfloat, GLfloat = 0.0, GLfloat = 1.0);
- static void glVertex(GLint, GLint, GLint = 0, GLint = 1);
static void glVertex(GLshort, GLshort, GLshort = 0, GLshort = 1);
+ static void glVertex(GLint, GLint, GLint = 0, GLint = 1);
+ static void glVertex(GLfloat, GLfloat, GLfloat = 0.0, GLfloat = 1.0);
+ static void glVertex(GLdouble, GLdouble, GLdouble = 0.0, GLdouble = 1.0);
private:
static int width, height, inited, twoD;
static SDL_Surface * surface;
diff --git a/lib/glbase.cc b/lib/glbase.cc
index 240b450..214f2d9 100644
--- a/lib/glbase.cc
+++ b/lib/glbase.cc
@@ -4,6 +4,8 @@
#include <SDL.h>
#include <SDL_opengl.h>
+#define DEBUG 1
+
int mogltk::glbase::width, mogltk::glbase::height, mogltk::glbase::inited = 0, mogltk::glbase::twoD = 0;
SDL_Surface * mogltk::glbase::surface = 0;
@@ -124,19 +126,31 @@ bool mogltk::glbase::is2D() {
return twoD;
}
-void mogltk::glbase::glVertex(GLdouble x, GLdouble y, GLdouble z, GLdouble w) {
- glVertex4d(x, y, z, w);
-}
-
-void mogltk::glbase::glVertex(GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
- glVertex4f(x, y, z, w);
+void mogltk::glbase::glVertex(GLshort x, GLshort y, GLshort z, GLshort w) {
+#ifdef DEBUG
+ printm(M_INFO, "Calling glVertex(%i, %i, %i, %i) (shorts)\n", x, y, z, w);
+#endif
+ glVertex4i(x, y, z, w);
}
void mogltk::glbase::glVertex(GLint x, GLint y, GLint z, GLint w) {
+#ifdef DEBUG
+ printm(M_INFO, "Calling glVertex(%i, %i, %i, %i) (ints)\n", x, y, z, w);
+#endif
glVertex4i(x, y, z, w);
}
-void mogltk::glbase::glVertex(GLshort x, GLshort y, GLshort z, GLshort w) {
- glVertex4i(x, y, z, w);
+void mogltk::glbase::glVertex(GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
+#ifdef DEBUG
+ printm(M_INFO, "Calling glVertex(%f, %f, %f, %f) (floats)\n", x, y, z, w);
+#endif
+ glVertex4f(x, y, z, w);
+}
+
+void mogltk::glbase::glVertex(GLdouble x, GLdouble y, GLdouble z, GLdouble w) {
+#ifdef DEBUG
+ printm(M_INFO, "Calling glVertex(%f, %f, %f, %f) (doubles)\n", x, y, z, w);
+#endif
+ glVertex4d(x, y, z, w);
}