summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-04-09 15:04:32 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-04-09 15:04:32 +0200
commite19c3838a4d89fb0640ed563ffdf58cd125cde7f (patch)
tree88a990b7bd54e8297d7619837ff6d8c4f928cd8e
parente9d6ab657235ebbf3eb9fcb35537c9b2181a1360 (diff)
#include cleanup
-rw-r--r--gl.h7
-rw-r--r--main.cpp6
-rw-r--r--quadtree.cpp7
-rw-r--r--quadtree.h2
-rw-r--r--scene.cpp2
-rw-r--r--shader.h4
-rw-r--r--video.cpp3
7 files changed, 14 insertions, 17 deletions
diff --git a/gl.h b/gl.h
new file mode 100644
index 0000000..bb28c20
--- /dev/null
+++ b/gl.h
@@ -0,0 +1,7 @@
+#ifndef GL_H
+#define GL_H
+
+#define GL_GLEXT_PROTOTYPES
+#include <SDL_opengl.h>
+
+#endif
diff --git a/main.cpp b/main.cpp
index c0871a5..97abb46 100644
--- a/main.cpp
+++ b/main.cpp
@@ -9,11 +9,7 @@
#include <boost/format.hpp>
#include <boost/shared_ptr.hpp>
-#define GL_GLEXT_PROTOTYPES
-#include <SDL_opengl.h>
-//#include <GL/gl.h>
-#include <GL/gl.h>
-//#include <GL/glu.h>
+#include "gl.h"
#include <iostream>
#include <cmath>
diff --git a/quadtree.cpp b/quadtree.cpp
index 8082ba7..1f2dd4a 100644
--- a/quadtree.cpp
+++ b/quadtree.cpp
@@ -4,8 +4,7 @@
#include <boost/format.hpp>
#include <boost/timer.hpp>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/gl.h>
+#include "gl.h"
#include <cmath>
#include <queue>
@@ -170,10 +169,10 @@ Quadtree::QuadChunk::QuadChunk(Quadtree *tree, float x, float y, float width, fl
this->y = y;
this->width = width;
this->height = height;
+ this->vbo_object = this->node_count = this->vertices = 0;
+ this->nodes = NULL;
if(width / chunk_size > 1) {
- node_count = 0;
- nodes = NULL;
for(int i = 0; i < 4; i++) {
float nx = x + ((i & 1) ^((i & 2) >> 1)) * width / 2;
float ny = y + ((i & 2) >> 1) * height / 2;
diff --git a/quadtree.h b/quadtree.h
index d6d1e8e..36e92ad 100644
--- a/quadtree.h
+++ b/quadtree.h
@@ -3,8 +3,6 @@
#include "vector.h"
-#include <list>
-
class Quadtree {
public:
struct QuadChunk;
diff --git a/scene.cpp b/scene.cpp
index 9e606f1..d6cfd80 100644
--- a/scene.cpp
+++ b/scene.cpp
@@ -1,7 +1,7 @@
#include "scene.h"
#include <SDL_image.h>
-#include <SDL_opengl.h>
+#include "gl.h"
#include <cmath>
diff --git a/shader.h b/shader.h
index 70f2361..1e11028 100644
--- a/shader.h
+++ b/shader.h
@@ -1,9 +1,7 @@
#ifndef SHADER_H
#define SHADER_H
-#define GL_GLEXT_PROTOTYPES
-#include <GL/gl.h>
-#include <GL/glu.h>
+#include "gl.h"
class GLBaseShader {
friend class GLShaderProgram;
diff --git a/video.cpp b/video.cpp
index 565a930..ab9b9d3 100644
--- a/video.cpp
+++ b/video.cpp
@@ -1,7 +1,6 @@
#include "video.h"
-#include <GL/gl.h>
-#include <GL/glu.h>
+#include "gl.h"
SDL_Surface *video::surface = NULL;
int video::width = 800;