Browse Source

Nothing important

Panagiotis Christopoulos Charitos 13 years ago
parent
commit
c398d3c022

+ 0 - 1
include/anki/collision/Collision.h

@@ -9,5 +9,4 @@
 #include "anki/collision/Frustum.h"
 #include "anki/collision/Aabb.h"
 
-
 #endif

+ 0 - 4
include/anki/collision/CollisionShape.h

@@ -4,10 +4,8 @@
 #include "anki/collision/Forward.h"
 #include "anki/math/Forward.h"
 
-
 namespace anki {
 
-
 /// @addtogroup Collision
 /// @{
 
@@ -98,8 +96,6 @@ private:
 };
 /// @}
 
-
 } // end namespace
 
-
 #endif

+ 0 - 4
include/anki/collision/Forward.h

@@ -1,10 +1,8 @@
 #ifndef ANKI_COLLISION_FORWARD_H
 #define ANKI_COLLISION_FORWARD_H
 
-
 namespace anki {
 
-
 class CollisionShape;
 
 class LineSegment;
@@ -15,8 +13,6 @@ class Ray;
 class Sphere;
 class Aabb;
 
-
 } // end namespace
 
-
 #endif

+ 1 - 1
include/anki/gl/BufferObject.h

@@ -1,7 +1,7 @@
 #ifndef ANKI_GL_BUFFER_OBJECT_H
 #define ANKI_GL_BUFFER_OBJECT_H
 
-#include <GL/glew.h>
+#include "anki/gl/Gl.h"
 #include "anki/util/Assert.h"
 
 namespace anki {

+ 1 - 1
include/anki/gl/Fbo.h

@@ -3,7 +3,7 @@
 
 #include "anki/util/Assert.h"
 #include "anki/util/Exception.h"
-#include <GL/glew.h>
+#include "anki/gl/Gl.h"
 #include <array>
 #include <initializer_list>
 

+ 9 - 0
include/anki/gl/Gl.h

@@ -0,0 +1,9 @@
+/// @file
+/// This file contains the correct OpenGL headers
+
+#ifndef ANKI_GL_GL_H
+#define ANKI_GL_GL_H
+
+#include <GL/glew.h>
+
+#endif

+ 1 - 1
include/anki/gl/GlState.h

@@ -2,7 +2,7 @@
 #define ANKI_GL_GL_STATE_H
 
 #include "anki/util/Singleton.h"
-#include <GL/glew.h>
+#include "anki/gl/Gl.h"
 #include <unordered_map>
 
 namespace anki {

+ 1 - 1
include/anki/gl/Query.h

@@ -1,8 +1,8 @@
 #ifndef ANKI_GL_QUERY_H
 #define ANKI_GL_QUERY_H
 
+#include "anki/gl/Gl.h"
 #include <cstdint>
-#include <GL/glew.h>
 
 namespace anki {
 

+ 1 - 1
include/anki/gl/ShaderProgram.h

@@ -6,8 +6,8 @@
 #include "anki/math/Forward.h"
 #include "anki/core/Globals.h"
 #include "anki/util/Flags.h"
+#include "anki/gl/Gl.h"
 #include <boost/ptr_container/ptr_vector.hpp>
-#include <GL/glew.h>
 #include <vector>
 #include <string>
 

+ 1 - 1
include/anki/gl/Texture.h

@@ -3,8 +3,8 @@
 
 #include "anki/util/Assert.h"
 #include "anki/util/Singleton.h"
+#include "anki/gl/Gl.h"
 #include <cstdlib>
-#include <GL/glew.h>
 #include <vector>
 #include <limits>
 #include <thread>

+ 1 - 1
include/anki/gl/Vao.h

@@ -3,7 +3,7 @@
 
 #include "anki/util/Assert.h"
 #include "anki/gl/GlException.h"
-#include <GL/glew.h>
+#include "anki/gl/Gl.h"
 
 namespace anki {
 

+ 0 - 4
include/anki/gl/Vbo.h

@@ -3,10 +3,8 @@
 
 #include "anki/gl/BufferObject.h"
 
-
 namespace anki {
 
-
 /// This is a wrapper for Vertex Buffer Objects to prevent us from making
 /// idiotic errors
 class Vbo: public BufferObject
@@ -43,8 +41,6 @@ public:
 	}
 };
 
-
 } // end namespace
 
-
 #endif

+ 1 - 0
src/gl/BufferObject.cpp

@@ -35,6 +35,7 @@ void BufferObject::create(GLenum target_, uint32_t sizeInBytes_,
 	sizeInBytes = sizeInBytes_;
 
 	glGenBuffers(1, &glId);
+	// XXX Check if zero
 	bind();
 	glBufferData(target, sizeInBytes, dataPtr, usage);
 

+ 25 - 3
src/gl/GlException.cpp

@@ -1,7 +1,7 @@
 #include "anki/gl/GlException.h"
+#include "anki/gl/Gl.h"
 #include "anki/util/Exception.h"
 #include <string>
-#include <GL/glew.h>
 
 namespace anki {
 
@@ -13,8 +13,30 @@ void glConditionalThrowException(const char* file, int line, const char* func)
 		return;
 	}
 
-	const char* glerr = reinterpret_cast<const char*>(gluErrorString(errId));
-	std::string err = std::string("OpenGL exception: ") + glerr;
+	const errStr = nullptr;
+
+	switch(errId)
+	{
+	case GL_INVALID_ENUM:
+		errStr = "GL_INVALID_ENUM";
+		break;
+	case GL_INVALID_VALUE:
+		errStr = "GL_INVALID_VALUE";
+		break;
+	case GL_INVALID_OPERATION:
+		errStr = "GL_INVALID_OPERATION";
+		break;
+	case GL_INVALID_FRAMEBUFFER_OPERATION:
+		errStr = "GL_INVALID_FRAMEBUFFER_OPERATION";
+		break;
+	case GL_OUT_OF_MEMORY:
+		errStr = "GL_OUT_OF_MEMORY";
+		break;
+	default:
+		errStr = "unknown";
+	};
+
+	std::string err = std::string("OpenGL exception: ") + errStr;
 	throw Exception(err.c_str(), file, line, func);
 }