Browse Source

Refactoring

Panagiotis Christopoulos Charitos 14 years ago
parent
commit
b1f7e7a63e

+ 1 - 1
docs/doxyfile

@@ -793,7 +793,7 @@ ALPHABETICAL_INDEX     = YES
 # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
 # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
 # in which this list will be split (can be a number in the range [1..20])
 # in which this list will be split (can be a number in the range [1..20])
 
 
-COLS_IN_ALPHA_INDEX    = 1
+COLS_IN_ALPHA_INDEX    = 2
 
 
 # In case all classes in a project start with a common prefix, all 
 # In case all classes in a project start with a common prefix, all 
 # classes will be put under the same header in the alphabetical index. 
 # classes will be put under the same header in the alphabetical index. 

+ 2 - 2
src/cln/Collision.h

@@ -1,5 +1,5 @@
-#ifndef COLLISION_H
-#define COLLISION_H
+#ifndef CLN_COLLISION_H
+#define CLN_COLLISION_H
 
 
 #include "Plane.h"
 #include "Plane.h"
 #include "Sphere.h"
 #include "Sphere.h"

+ 1 - 0
src/cln/CollisionShape.h

@@ -2,6 +2,7 @@
 #define CLN_COLLISION_SHAPE
 #define CLN_COLLISION_SHAPE
 
 
 
 
+/// Contains collision detection classes
 namespace cln {
 namespace cln {
 
 
 
 

+ 1 - 0
src/event/Event.h

@@ -5,6 +5,7 @@
 #include "util/Accessors.h"
 #include "util/Accessors.h"
 
 
 
 
+/// Events namespace
 namespace event {
 namespace event {
 
 
 
 

+ 6 - 0
src/gl/BufferObject.cpp

@@ -4,6 +4,9 @@
 #include "util/Exception.h"
 #include "util/Exception.h"
 
 
 
 
+namespace gl {
+
+
 //==============================================================================
 //==============================================================================
 // Destructor                                                                  =
 // Destructor                                                                  =
 //==============================================================================
 //==============================================================================
@@ -82,3 +85,6 @@ void BufferObject::write(void* buff, size_t offset, size_t size)
 	glUnmapBuffer(target);
 	glUnmapBuffer(target);
 	unbind();
 	unbind();
 }
 }
+
+
+} // end namespace

+ 9 - 2
src/gl/BufferObject.h

@@ -1,11 +1,15 @@
-#ifndef BUFFER_OBJECT_H
-#define BUFFER_OBJECT_H
+#ifndef GL_BUFFER_OBJECT_H
+#define GL_BUFFER_OBJECT_H
 
 
 #include <GL/glew.h>
 #include <GL/glew.h>
 #include "util/Assert.h"
 #include "util/Assert.h"
 #include "util/StdTypes.h"
 #include "util/StdTypes.h"
 
 
 
 
+/// Contains OpenGL wrappers
+namespace gl {
+
+
 /// A wrapper for OpenGL buffer objects (vertex arrays, texture buffers etc)
 /// A wrapper for OpenGL buffer objects (vertex arrays, texture buffers etc)
 /// to prevent us from making idiotic errors
 /// to prevent us from making idiotic errors
 class BufferObject
 class BufferObject
@@ -141,4 +145,7 @@ inline void BufferObject::deleteBuff()
 }
 }
 
 
 
 
+} // end namespace
+
+
 #endif
 #endif

+ 6 - 0
src/gl/Fbo.cpp

@@ -2,6 +2,9 @@
 #include <boost/lexical_cast.hpp>
 #include <boost/lexical_cast.hpp>
 
 
 
 
+namespace gl {
+
+
 //==============================================================================
 //==============================================================================
 // Destructor                                                                  =
 // Destructor                                                                  =
 //==============================================================================
 //==============================================================================
@@ -67,3 +70,6 @@ uint Fbo::getCurrentFbo()
 	glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fboGlId);
 	glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fboGlId);
 	return (uint)fboGlId;
 	return (uint)fboGlId;
 }
 }
+
+
+} // end namespace

+ 8 - 2
src/gl/Fbo.h

@@ -1,5 +1,5 @@
-#ifndef FBO_H
-#define FBO_H
+#ifndef GL_FBO_H
+#define GL_FBO_H
 
 
 #include <GL/glew.h>
 #include <GL/glew.h>
 #include "util/Assert.h"
 #include "util/Assert.h"
@@ -7,6 +7,9 @@
 #include "util/Exception.h"
 #include "util/Exception.h"
 
 
 
 
+namespace gl {
+
+
 /// The class is actually a wrapper to avoid common mistakes
 /// The class is actually a wrapper to avoid common mistakes
 class Fbo
 class Fbo
 {
 {
@@ -92,4 +95,7 @@ inline void Fbo::destroy()
 }
 }
 
 
 
 
+} // end namespace
+
+
 #endif
 #endif

+ 6 - 0
src/gl/TimeQuery.cpp

@@ -3,6 +3,9 @@
 #include "GlException.h"
 #include "GlException.h"
 
 
 
 
+namespace gl {
+
+
 //==============================================================================
 //==============================================================================
 // Constructor                                                                 =
 // Constructor                                                                 =
 //==============================================================================
 //==============================================================================
@@ -61,3 +64,6 @@ double TimeQuery::end()
 
 
 	return (timerEnd - timerStart) / 1000000000.0;
 	return (timerEnd - timerStart) / 1000000000.0;
 }
 }
+
+
+} // end namespace

+ 8 - 2
src/gl/TimeQuery.h

@@ -1,10 +1,13 @@
-#ifndef TIME_QUERY_H
-#define TIME_QUERY_H
+#ifndef GL_TIME_QUERY_H
+#define GL_TIME_QUERY_H
 
 
 #include <GL/glew.h>
 #include <GL/glew.h>
 #include <boost/array.hpp>
 #include <boost/array.hpp>
 
 
 
 
+namespace gl {
+
+
 /// Used to profile the GPU. It gets the time elapsed from when the begin() is
 /// Used to profile the GPU. It gets the time elapsed from when the begin() is
 /// called until the endAndGetTimeElapsed() method. The query causes
 /// called until the endAndGetTimeElapsed() method. The query causes
 /// synchronization issues because it waits for the GL commands to finish. For
 /// synchronization issues because it waits for the GL commands to finish. For
@@ -36,4 +39,7 @@ class TimeQuery
 };
 };
 
 
 
 
+} // end namespace
+
+
 #endif
 #endif

+ 6 - 0
src/gl/Vao.cpp

@@ -4,6 +4,9 @@
 #include "rsrc/ShaderProgramAttributeVariable.h"
 #include "rsrc/ShaderProgramAttributeVariable.h"
 
 
 
 
+namespace gl {
+
+
 //==============================================================================
 //==============================================================================
 // Destructor                                                                  =
 // Destructor                                                                  =
 //==============================================================================
 //==============================================================================
@@ -72,3 +75,6 @@ void Vao::attachElementArrayBufferVbo(const Vbo& vbo)
 	unbind();
 	unbind();
 	ON_GL_FAIL_THROW_EXCEPTION();
 	ON_GL_FAIL_THROW_EXCEPTION();
 }
 }
+
+
+} // end namespace

+ 11 - 3
src/gl/Vao.h

@@ -1,5 +1,5 @@
-#ifndef VAO_H
-#define VAO_H
+#ifndef GL_VAO_H
+#define GL_VAO_H
 
 
 #include <GL/glew.h>
 #include <GL/glew.h>
 #include "util/StdTypes.h"
 #include "util/StdTypes.h"
@@ -7,10 +7,15 @@
 #include "GlException.h"
 #include "GlException.h"
 
 
 
 
-class Vbo;
 class ShaderProgramAttributeVariable;
 class ShaderProgramAttributeVariable;
 
 
 
 
+namespace gl {
+
+
+class Vbo;
+
+
 /// Vertex array object
 /// Vertex array object
 class Vao
 class Vao
 {
 {
@@ -114,4 +119,7 @@ inline uint Vao::getGlId() const
 }
 }
 
 
 
 
+} // end namespace
+
+
 #endif
 #endif

+ 8 - 2
src/gl/Vbo.h

@@ -1,9 +1,12 @@
-#ifndef VBO_H
-#define VBO_H
+#ifndef GL_VBO_H
+#define GL_VBO_H
 
 
 #include "BufferObject.h"
 #include "BufferObject.h"
 
 
 
 
+namespace gl {
+
+
 /// This is a wrapper for Vertex Buffer Objects to prevent us from making
 /// This is a wrapper for Vertex Buffer Objects to prevent us from making
 /// idiotic errors
 /// idiotic errors
 class Vbo: public BufferObject
 class Vbo: public BufferObject
@@ -50,4 +53,7 @@ inline void Vbo::unbindAllTargets()
 }
 }
 
 
 
 
+} // end namespace
+
+
 #endif
 #endif

+ 1 - 0
src/m/Funcs.h

@@ -4,6 +4,7 @@
 #include "Common.h"
 #include "Common.h"
 
 
 
 
+/// Math library namespace
 namespace m {
 namespace m {
 
 
 
 

+ 2 - 2
src/m/Math.h

@@ -1,5 +1,5 @@
-#ifndef MATH_H
-#define MATH_H
+#ifndef M_MATH_H
+#define M_MATH_H
 
 
 
 
 #include <math.h>
 #include <math.h>

+ 2 - 2
src/misc/Parser.h

@@ -8,7 +8,7 @@
 
 
 /// It contains some functions and macros that are used pretty often while
 /// It contains some functions and macros that are used pretty often while
 /// parsing
 /// parsing
-namespace Parser {
+namespace parser {
 
 
 /// Parser macros
 /// Parser macros
 #define PARSER_EXCEPTION(x) \
 #define PARSER_EXCEPTION(x) \
@@ -66,7 +66,7 @@ extern bool isIdentifier(const scanner::Token& token, const char* str);
 extern std::string parseString(scanner::Scanner& scanner);
 extern std::string parseString(scanner::Scanner& scanner);
 
 
 
 
-} // end namespace Parser
+} // end namespace
 
 
 
 
 #include "Parser.inl.h"
 #include "Parser.inl.h"

+ 2 - 2
src/misc/Parser.inl.h

@@ -3,7 +3,7 @@
 #include "util/Exception.h"
 #include "util/Exception.h"
 
 
 
 
-namespace Parser {
+namespace parser {
 
 
 
 
 //==============================================================================
 //==============================================================================
@@ -256,4 +256,4 @@ inline std::string parseString(scanner::Scanner& scanner)
 }
 }
 
 
 
 
-} // End namespace Parser
+} // End namespace

+ 3 - 3
src/r/Bl.h

@@ -31,9 +31,9 @@ class Bl: private RenderingPass
 		/// @}
 		/// @}
 
 
 	private:
 	private:
-		Fbo hBlurFbo; ///< Fbo that writes to blurFai
-		Fbo vBlurFbo; ///< Fbo that writes to postPassSProg
-		Fbo sideBlurFbo;
+		gl::Fbo hBlurFbo; ///< Fbo that writes to blurFai
+		gl::Fbo vBlurFbo; ///< Fbo that writes to postPassSProg
+		gl::Fbo sideBlurFbo;
 
 
 		RsrcPtr<ShaderProgram> hBlurSProg;
 		RsrcPtr<ShaderProgram> hBlurSProg;
 		RsrcPtr<ShaderProgram> vBlurSProg;
 		RsrcPtr<ShaderProgram> vBlurSProg;

+ 2 - 2
src/r/Bs.h

@@ -25,8 +25,8 @@ class Bs: public RenderingPass
 		void run();
 		void run();
 
 
 	private:
 	private:
-		Fbo fbo; ///< Writes to Pps::prePassFai
-		Fbo refractFbo; ///< Writes to refractFai
+		gl::Fbo fbo; ///< Writes to Pps::prePassFai
+		gl::Fbo refractFbo; ///< Writes to refractFai
 		RsrcPtr<ShaderProgram> refractSProg;
 		RsrcPtr<ShaderProgram> refractSProg;
 		Texture refractFai;
 		Texture refractFai;
 
 

+ 4 - 4
src/r/Dbg.h

@@ -58,7 +58,7 @@ class Dbg: public RenderingPass
 		bool showSkeletonsEnabled;
 		bool showSkeletonsEnabled;
 		bool showCamerasEnabled;
 		bool showCamerasEnabled;
 		bool showVisibilityBoundingShapesFlag;
 		bool showVisibilityBoundingShapesFlag;
-		Fbo fbo;
+		gl::Fbo fbo;
 		RsrcPtr<ShaderProgram> sProg;
 		RsrcPtr<ShaderProgram> sProg;
 		static const uint MAX_POINTS_PER_DRAW = 256;
 		static const uint MAX_POINTS_PER_DRAW = 256;
 		boost::array<Vec3, MAX_POINTS_PER_DRAW> positions;
 		boost::array<Vec3, MAX_POINTS_PER_DRAW> positions;
@@ -66,9 +66,9 @@ class Dbg: public RenderingPass
 		Mat4 modelMat;
 		Mat4 modelMat;
 		uint pointIndex;
 		uint pointIndex;
 		Vec3 crntCol;
 		Vec3 crntCol;
-		Vbo positionsVbo;
-		Vbo colorsVbo;
-		Vao vao;
+		gl::Vbo positionsVbo;
+		gl::Vbo colorsVbo;
+		gl::Vao vao;
 		SceneDbgDrawer sceneDbgDrawer;
 		SceneDbgDrawer sceneDbgDrawer;
 		CollisionDbgDrawer collisionDbgDrawer;
 		CollisionDbgDrawer collisionDbgDrawer;
 
 

+ 1 - 1
src/r/Ez.h

@@ -21,7 +21,7 @@ class Ez: public RenderingPass
 		void run();
 		void run();
 
 
 	private:
 	private:
-		Fbo fbo; ///< Writes to MS depth FAI
+		gl::Fbo fbo; ///< Writes to MS depth FAI
 		bool enabled;
 		bool enabled;
 };
 };
 
 

+ 1 - 1
src/r/Hdr.cpp

@@ -25,7 +25,7 @@ Hdr::~Hdr()
 //==============================================================================
 //==============================================================================
 // initFbo                                                                    =
 // initFbo                                                                    =
 //==============================================================================
 //==============================================================================
-void Hdr::initFbo(Fbo& fbo, Texture& fai)
+void Hdr::initFbo(gl::Fbo& fbo, Texture& fai)
 {
 {
 	try
 	try
 	{
 	{

+ 4 - 4
src/r/Hdr.h

@@ -44,9 +44,9 @@ class Hdr: private RenderingPass
 		uint blurringIterationsNum; ///< The blurring iterations of the tone map
 		uint blurringIterationsNum; ///< The blurring iterations of the tone map
 		float blurringDist; ///< Distance in blurring
 		float blurringDist; ///< Distance in blurring
 		float renderingQuality;
 		float renderingQuality;
-		Fbo toneFbo;
-		Fbo hblurFbo;
-		Fbo vblurFbo;
+		gl::Fbo toneFbo;
+		gl::Fbo hblurFbo;
+		gl::Fbo vblurFbo;
 		RsrcPtr<ShaderProgram> toneSProg;
 		RsrcPtr<ShaderProgram> toneSProg;
 		RsrcPtr<ShaderProgram> hblurSProg;
 		RsrcPtr<ShaderProgram> hblurSProg;
 		RsrcPtr<ShaderProgram> vblurSProg;
 		RsrcPtr<ShaderProgram> vblurSProg;
@@ -54,7 +54,7 @@ class Hdr: private RenderingPass
 		Texture hblurFai; ///< pass0Fai with the horizontal blur FAI
 		Texture hblurFai; ///< pass0Fai with the horizontal blur FAI
 		Texture fai; ///< The final FAI
 		Texture fai; ///< The final FAI
 
 
-		void initFbo(Fbo& fbo, Texture& fai);
+		void initFbo(gl::Fbo& fbo, Texture& fai);
 };
 };
 
 
 
 

+ 3 - 3
src/r/Is.h

@@ -36,12 +36,12 @@ class Is: private RenderingPass
 	private:
 	private:
 		Sm sm; ///< Shadowmapping pass
 		Sm sm; ///< Shadowmapping pass
 		Smo smo; /// Stencil masking optimizations pass
 		Smo smo; /// Stencil masking optimizations pass
-		Fbo fbo; ///< This FBO writes to the Is::fai
+		gl::Fbo fbo; ///< This FBO writes to the Is::fai
 		Texture fai; ///< The one and only FAI
 		Texture fai; ///< The one and only FAI
 		uint stencilRb; ///< Illumination stage stencil buffer
 		uint stencilRb; ///< Illumination stage stencil buffer
 		Texture copyMsDepthFai;
 		Texture copyMsDepthFai;
-		Fbo readFbo;
-		Fbo writeFbo;
+		gl::Fbo readFbo;
+		gl::Fbo writeFbo;
 		/// Illumination stage ambient pass shader program
 		/// Illumination stage ambient pass shader program
 		RsrcPtr<ShaderProgram> ambientPassSProg;
 		RsrcPtr<ShaderProgram> ambientPassSProg;
 		/// Illumination stage point light shader program
 		/// Illumination stage point light shader program

+ 1 - 1
src/r/MainRenderer.cpp

@@ -43,7 +43,7 @@ void MainRenderer::init(const RendererInitializer& initializer_)
 
 
 	sProg.loadRsrc("shaders/Final.glsl");
 	sProg.loadRsrc("shaders/Final.glsl");
 
 
-	dbgTq.reset(new TimeQuery);
+	dbgTq.reset(new gl::TimeQuery);
 
 
 	//
 	//
 	// init the offscreen Renderer
 	// init the offscreen Renderer

+ 1 - 1
src/r/MainRenderer.h

@@ -52,7 +52,7 @@ class MainRenderer: public Renderer
 		/// @name Profiling stuff
 		/// @name Profiling stuff
 		/// @{
 		/// @{
 		double dbgTime;
 		double dbgTime;
-		boost::scoped_ptr<TimeQuery> dbgTq;
+		boost::scoped_ptr<gl::TimeQuery> dbgTq;
 		/// @}
 		/// @}
 
 
 		RsrcPtr<ShaderProgram> sProg; ///< Final pass' shader program
 		RsrcPtr<ShaderProgram> sProg; ///< Final pass' shader program

+ 1 - 1
src/r/Ms.h

@@ -31,7 +31,7 @@ class Ms: public RenderingPass
 
 
 	private:
 	private:
 		Ez ez; /// EarlyZ pass
 		Ez ez; /// EarlyZ pass
-		Fbo fbo;
+		gl::Fbo fbo;
 		Texture normalFai; ///< The FAI for normals
 		Texture normalFai; ///< The FAI for normals
 		Texture diffuseFai; ///< The FAI for diffuse color
 		Texture diffuseFai; ///< The FAI for diffuse color
 		Texture specularFai; ///< The FAI for specular color and shininess
 		Texture specularFai; ///< The FAI for specular color and shininess

+ 2 - 2
src/r/Pps.h

@@ -46,8 +46,8 @@ class Pps: private RenderingPass
 		Bl bl;
 		Bl bl;
 		/// @}
 		/// @}
 
 
-		Fbo prePassFbo;
-		Fbo postPassFbo;
+		gl::Fbo prePassFbo;
+		gl::Fbo postPassFbo;
 
 
 		RsrcPtr<ShaderProgram> prePassSProg;
 		RsrcPtr<ShaderProgram> prePassSProg;
 		RsrcPtr<ShaderProgram> postPassSProg;
 		RsrcPtr<ShaderProgram> postPassSProg;

+ 4 - 4
src/r/Renderer.cpp

@@ -70,10 +70,10 @@ void Renderer::init(const RendererInitializer& initializer)
 	quadVao.attachElementArrayBufferVbo(quadVertIndecesVbo);
 	quadVao.attachElementArrayBufferVbo(quadVertIndecesVbo);
 
 
 	// Other
 	// Other
-	msTq.reset(new TimeQuery);
-	isTq.reset(new TimeQuery);
-	ppsTq.reset(new TimeQuery);
-	bsTq.reset(new TimeQuery);
+	msTq.reset(new gl::TimeQuery);
+	isTq.reset(new gl::TimeQuery);
+	ppsTq.reset(new gl::TimeQuery);
+	bsTq.reset(new gl::TimeQuery);
 }
 }
 
 
 
 

+ 6 - 4
src/r/Renderer.h

@@ -24,6 +24,8 @@ class Camera;
 struct RendererInitializer;
 struct RendererInitializer;
 class ModelNode;
 class ModelNode;
 
 
+
+/// Renderer namespace
 namespace r {
 namespace r {
 
 
 
 
@@ -125,7 +127,7 @@ class Renderer
 		/// @name Profiling stuff
 		/// @name Profiling stuff
 		/// @{
 		/// @{
 		double msTime, isTime, ppsTime, bsTime;
 		double msTime, isTime, ppsTime, bsTime;
-		boost::scoped_ptr<TimeQuery> msTq, isTq, ppsTq, bsTq;
+		boost::scoped_ptr<gl::TimeQuery> msTq, isTq, ppsTq, bsTq;
 		bool enableStagesProfilingFlag;
 		bool enableStagesProfilingFlag;
 		/// @}
 		/// @}
 
 
@@ -160,9 +162,9 @@ class Renderer
 
 
 		/// @name For drawing a quad into the active framebuffer
 		/// @name For drawing a quad into the active framebuffer
 		/// @{
 		/// @{
-		Vbo quadPositionsVbo; ///< The VBO for quad positions
-		Vbo quadVertIndecesVbo; ///< The VBO for quad array buffer elements
-		Vao quadVao; ///< This VAO is used everywhere except material stage
+		gl::Vbo quadPositionsVbo; ///< The VBO for quad positions
+		gl::Vbo quadVertIndecesVbo; ///< The VBO for quad array buffer elements
+		gl::Vao quadVao; ///< This VAO is used everywhere except material stage
 		/// @}
 		/// @}
 };
 };
 
 

+ 1 - 1
src/r/Sm.h

@@ -46,7 +46,7 @@ class Sm: private RenderingPass
 		/// used
 		/// used
 		struct Level
 		struct Level
 		{
 		{
-			Fbo fbo; ///< Illumination stage shadowmapping FBO
+			gl::Fbo fbo; ///< Illumination stage shadowmapping FBO
 			Texture shadowMap; ///< The shadowmap for that level
 			Texture shadowMap; ///< The shadowmap for that level
 			uint resolution; ///< The shadowmap's resolution
 			uint resolution; ///< The shadowmap's resolution
 			bool bilinear; ///< Enable bilinar filtering in shadowmap
 			bool bilinear; ///< Enable bilinar filtering in shadowmap

+ 1 - 1
src/r/Smo.h

@@ -35,7 +35,7 @@ class Smo: public RenderingPass
 			~Geom();
 			~Geom();
 
 
 			RsrcPtr<Mesh> mesh;
 			RsrcPtr<Mesh> mesh;
-			Vao vao;
+			gl::Vao vao;
 		};
 		};
 
 
 		Geom sphereGeom;
 		Geom sphereGeom;

+ 1 - 1
src/r/Ssao.cpp

@@ -12,7 +12,7 @@ namespace r {
 //==============================================================================
 //==============================================================================
 // createFbo                                                                   =
 // createFbo                                                                   =
 //==============================================================================
 //==============================================================================
-void Ssao::createFbo(Fbo& fbo, Texture& fai)
+void Ssao::createFbo(gl::Fbo& fbo, Texture& fai)
 {
 {
 	try
 	try
 	{
 	{

+ 4 - 4
src/r/Ssao.h

@@ -40,15 +40,15 @@ class Ssao: private RenderingPass
 		bool enabled;
 		bool enabled;
 		float renderingQuality;
 		float renderingQuality;
 		float blurringIterationsNum;
 		float blurringIterationsNum;
-		Fbo ssaoFbo;
-		Fbo hblurFbo;
-		Fbo vblurFbo;
+		gl::Fbo ssaoFbo;
+		gl::Fbo hblurFbo;
+		gl::Fbo vblurFbo;
 		RsrcPtr<Texture> noiseMap;
 		RsrcPtr<Texture> noiseMap;
 		RsrcPtr<ShaderProgram> ssaoSProg;
 		RsrcPtr<ShaderProgram> ssaoSProg;
 		RsrcPtr<ShaderProgram> hblurSProg;
 		RsrcPtr<ShaderProgram> hblurSProg;
 		RsrcPtr<ShaderProgram> vblurSProg;
 		RsrcPtr<ShaderProgram> vblurSProg;
 
 
-		void createFbo(Fbo& fbo, Texture& fai);
+		void createFbo(gl::Fbo& fbo, Texture& fai);
 };
 };
 
 
 
 

+ 2 - 2
src/rsrc/Mesh.h

@@ -36,7 +36,7 @@ class Mesh
 
 
 		/// @name Accessors
 		/// @name Accessors
 		/// @{
 		/// @{
-		const Vbo& getVbo(Vbos id) const {return vbos[id];}
+		const gl::Vbo& getVbo(Vbos id) const {return vbos[id];}
 		GETTER_R_BY_VAL(uint, vertIdsNum, getVertIdsNum)
 		GETTER_R_BY_VAL(uint, vertIdsNum, getVertIdsNum)
 		GETTER_R(cln::Obb, visibilityShape, getVisibilityShape)
 		GETTER_R(cln::Obb, visibilityShape, getVisibilityShape)
 		GETTER_R_BY_VAL(uint, vertsNum, getVertsNum)
 		GETTER_R_BY_VAL(uint, vertsNum, getVertsNum)
@@ -53,7 +53,7 @@ class Mesh
 		/// @}
 		/// @}
 
 
 	private:
 	private:
-		boost::array<Vbo, VBOS_NUM> vbos; ///< The vertex buffer objects
+		boost::array<gl::Vbo, VBOS_NUM> vbos; ///< The vertex buffer objects
 		uint vertIdsNum; ///< The number of vertex IDs
 		uint vertIdsNum; ///< The number of vertex IDs
 		cln::Obb visibilityShape;
 		cln::Obb visibilityShape;
 		uint vertsNum;
 		uint vertsNum;

+ 6 - 6
src/rsrc/ShaderProgramPrePreprocessor.cpp

@@ -67,25 +67,25 @@ void ShaderProgramPrePreprocessor::parseFileForPragmas(
 		{
 		{
 			token = &scanner.getNextToken();
 			token = &scanner.getNextToken();
 			// pragma
 			// pragma
-			if(Parser::isIdentifier(*token, "pragma"))
+			if(parser::isIdentifier(*token, "pragma"))
 			{
 			{
 				token = &scanner.getNextToken();
 				token = &scanner.getNextToken();
 				// anki
 				// anki
-				if(Parser::isIdentifier(*token, "anki"))
+				if(parser::isIdentifier(*token, "anki"))
 				{
 				{
 					// start
 					// start
 					token = &scanner.getNextToken();
 					token = &scanner.getNextToken();
-					if(Parser::isIdentifier(*token, "start"))
+					if(parser::isIdentifier(*token, "start"))
 					{
 					{
 						parseStartPragma(scanner, filename, depth, lines);
 						parseStartPragma(scanner, filename, depth, lines);
 					}
 					}
 					// include
 					// include
-					else if(Parser::isIdentifier(*token, "include"))
+					else if(parser::isIdentifier(*token, "include"))
 					{
 					{
 						parseIncludePragma(scanner, filename, depth, lines);
 						parseIncludePragma(scanner, filename, depth, lines);
 					}
 					}
 					// transformFeedbackVarying
 					// transformFeedbackVarying
-					else if(Parser::isIdentifier(*token,
+					else if(parser::isIdentifier(*token,
 						"transformFeedbackVarying"))
 						"transformFeedbackVarying"))
 					{
 					{
 						parseTrffbVarying(scanner, filename, depth, lines);
 						parseTrffbVarying(scanner, filename, depth, lines);
@@ -236,7 +236,7 @@ void ShaderProgramPrePreprocessor::parseStartPragma(scanner::Scanner& scanner,
 
 
 	for(uint i = 0; i < ST_NUM; i++)
 	for(uint i = 0; i < ST_NUM; i++)
 	{
 	{
-		if(Parser::isIdentifier(*token, startTokens[i]))
+		if(parser::isIdentifier(*token, startTokens[i]))
 		{
 		{
 			cbp = &shaderStarts[i];
 			cbp = &shaderStarts[i];
 			name = startTokens[i];
 			name = startTokens[i];

+ 3 - 3
src/rsrc/SkelAnim.cpp

@@ -19,7 +19,7 @@ void SkelAnim::load(const char* filename)
 	}
 	}
 	keyframes.resize(token->getValue().getInt());
 	keyframes.resize(token->getValue().getInt());
 
 
-	Parser::parseArrOfNumbers(scanner, false, false, keyframes.size(),
+	parser::parseArrOfNumbers(scanner, false, false, keyframes.size(),
 		&keyframes[0]);
 		&keyframes[0]);
 
 
 	// bones num
 	// bones num
@@ -49,11 +49,11 @@ void SkelAnim::load(const char* filename)
 			{
 			{
 				// parse the quat
 				// parse the quat
 				float tmp[4];
 				float tmp[4];
-				Parser::parseArrOfNumbers(scanner, false, true, 4, &tmp[0]);
+				parser::parseArrOfNumbers(scanner, false, true, 4, &tmp[0]);
 
 
 				// parse the vec3
 				// parse the vec3
 				Vec3 trs;
 				Vec3 trs;
-				Parser::parseArrOfNumbers(scanner, false, true, 3, &trs[0]);
+				parser::parseArrOfNumbers(scanner, false, true, 3, &trs[0]);
 
 
 				boneAnims[i].bonePoses.push_back(BonePose(Quat(tmp[1], tmp[2],
 				boneAnims[i].bonePoses.push_back(BonePose(Quat(tmp[1], tmp[2],
 					tmp[3], tmp[0]), trs));
 					tmp[3], tmp[0]), trs));

+ 1 - 1
src/scene/ModelPatchNode.cpp

@@ -14,7 +14,7 @@ ModelPatchNode::ModelPatchNode(const ModelPatch& modelPatch_,
 	ModelNode* parent)
 	ModelNode* parent)
 :	PatchNode(modelPatch_, parent)
 :	PatchNode(modelPatch_, parent)
 {
 {
-	boost::array<const Vbo*, Mesh::VBOS_NUM> vboArr;
+	VboArray vboArr;
 
 
 	for(uint i = 0; i < Mesh::VBOS_NUM; i++)
 	for(uint i = 0; i < Mesh::VBOS_NUM; i++)
 	{
 	{

+ 2 - 2
src/scene/PatchNode.cpp

@@ -16,8 +16,8 @@ PatchNode::PatchNode(const ModelPatch& modelPatch, SceneNode* parent)
 //==============================================================================
 //==============================================================================
 // createVao                                                                   =
 // createVao                                                                   =
 //==============================================================================
 //==============================================================================
-void PatchNode::createVao(const Material& mtl, const boost::array<const Vbo*,
-	Mesh::VBOS_NUM>& vbos, Vao& vao)
+void PatchNode::createVao(const Material& mtl, const VboArray& vbos,
+	gl::Vao& vao)
 {
 {
 	vao.create();
 	vao.create();
 
 

+ 6 - 3
src/scene/PatchNode.h

@@ -20,6 +20,8 @@ class Material;
 class PatchNode: public RenderableNode
 class PatchNode: public RenderableNode
 {
 {
 	public:
 	public:
+		typedef boost::array<const gl::Vbo*, Mesh::VBOS_NUM> VboArray;
+
 		PatchNode(const ModelPatch& modelPatch, SceneNode* parent);
 		PatchNode(const ModelPatch& modelPatch, SceneNode* parent);
 
 
 		/// Do nothing
 		/// Do nothing
@@ -29,7 +31,7 @@ class PatchNode: public RenderableNode
 		/// @{
 		/// @{
 
 
 		/// Implements RenderableNode::getVao
 		/// Implements RenderableNode::getVao
-		const Vao& getVao(PassType p) const {return vaos[p];}
+		const gl::Vao& getVao(PassType p) const {return vaos[p];}
 
 
 		/// Implements RenderableNode::getVertIdsNum
 		/// Implements RenderableNode::getVertIdsNum
 		uint getVertIdsNum() const {return rsrc.getMesh().getVertIdsNum();}
 		uint getVertIdsNum() const {return rsrc.getMesh().getVertIdsNum();}
@@ -51,7 +53,7 @@ class PatchNode: public RenderableNode
 		const ModelPatch& rsrc;
 		const ModelPatch& rsrc;
 
 
 		/// The VAOs. All VBOs could be attached except for the vertex weights
 		/// The VAOs. All VBOs could be attached except for the vertex weights
-		boost::array<Vao, PASS_TYPES_NUM> vaos;
+		boost::array<gl::Vao, PASS_TYPES_NUM> vaos;
 
 
 		boost::scoped_ptr<MaterialRuntime> mtlRun; ///< Material runtime
 		boost::scoped_ptr<MaterialRuntime> mtlRun; ///< Material runtime
 
 
@@ -59,7 +61,8 @@ class PatchNode: public RenderableNode
 		/// The location of the uniform variables are hard coded. See
 		/// The location of the uniform variables are hard coded. See
 		/// MaterialVertex.glsl
 		/// MaterialVertex.glsl
 		static void createVao(const Material& material,
 		static void createVao(const Material& material,
-			const boost::array<const Vbo*, Mesh::VBOS_NUM>& vbos, Vao& vao);
+			const VboArray& vbos,
+			gl::Vao& vao);
 };
 };
 
 
 
 

+ 3 - 1
src/scene/RenderableNode.h

@@ -5,7 +5,9 @@
 #include "rsrc/MaterialCommon.h"
 #include "rsrc/MaterialCommon.h"
 
 
 
 
+namespace gl {
 class Vao;
 class Vao;
+}
 class Material;
 class Material;
 class MaterialRuntime;
 class MaterialRuntime;
 
 
@@ -19,7 +21,7 @@ class RenderableNode: public SceneNode
 		virtual ~RenderableNode();
 		virtual ~RenderableNode();
 
 
 		/// Get VAO depending the rendering pass
 		/// Get VAO depending the rendering pass
-		virtual const Vao& getVao(PassType p) const = 0;
+		virtual const gl::Vao& getVao(PassType p) const = 0;
 
 
 		/// Get vert ids number for rendering
 		/// Get vert ids number for rendering
 		virtual uint getVertIdsNum() const = 0;
 		virtual uint getVertIdsNum() const = 0;

+ 1 - 1
src/scene/SkinPatchNode.cpp

@@ -11,7 +11,7 @@
 SkinPatchNode::SkinPatchNode(const ModelPatch& modelPatch_, SkinNode* parent)
 SkinPatchNode::SkinPatchNode(const ModelPatch& modelPatch_, SkinNode* parent)
 :	PatchNode(modelPatch_, parent)
 :	PatchNode(modelPatch_, parent)
 {
 {
-	boost::array<const Vbo*, Mesh::VBOS_NUM> vboArr;
+	VboArray vboArr;
 
 
 	for(uint i = 0; i < Mesh::VBOS_NUM; i++)
 	for(uint i = 0; i < Mesh::VBOS_NUM; i++)
 	{
 	{

+ 4 - 4
src/scene/SkinPatchNode.h

@@ -37,14 +37,14 @@ class SkinPatchNode: public PatchNode
 
 
 		/// @name Accessors
 		/// @name Accessors
 		/// @{
 		/// @{
-		GETTER_R(Vao, tfVao, getTfVao)
-		const Vbo& getTfVbo(uint i) const {return tfVbos[i];}
+		GETTER_R(gl::Vao, tfVao, getTfVao)
+		const gl::Vbo& getTfVbo(uint i) const {return tfVbos[i];}
 		/// @}
 		/// @}
 
 
 	private:
 	private:
 		/// VBOs that contain the deformed vertex attributes
 		/// VBOs that contain the deformed vertex attributes
-		boost::array<Vbo, TFV_NUM> tfVbos;
-		Vao tfVao; ///< For TF passes
+		boost::array<gl::Vbo, TFV_NUM> tfVbos;
+		gl::Vao tfVao; ///< For TF passes
 };
 };
 
 
 
 

+ 3 - 3
src/ui/Painter.h

@@ -44,9 +44,9 @@ class Painter
 		Vec4 col;
 		Vec4 col;
 		uint tabSize;
 		uint tabSize;
 
 
-		Vbo qPositionsVbo;
-		Vbo qIndecesVbo;
-		Vao qVao;
+		gl::Vbo qPositionsVbo;
+		gl::Vbo qIndecesVbo;
+		gl::Vao qVao;
 
 
 		Vec2 deviceSize; ///< The size of the device in pixels
 		Vec2 deviceSize; ///< The size of the device in pixels
 		/// @}
 		/// @}

+ 1 - 1
src/ui/PainterDevice.cpp

@@ -27,7 +27,7 @@ Vec2 PainterDevice::getSize() const
 //==============================================================================
 //==============================================================================
 void PainterDevice::create()
 void PainterDevice::create()
 {
 {
-	Fbo::create();
+	gl::Fbo::create();
 	bind();
 	bind();
 
 
 	setNumOfColorAttachements(1);
 	setNumOfColorAttachements(1);

+ 1 - 1
src/ui/PainterDevice.h

@@ -13,7 +13,7 @@ namespace ui {
 
 
 
 
 /// This actually and FBO but with size info
 /// This actually and FBO but with size info
-class PainterDevice: public Fbo
+class PainterDevice: public gl::Fbo
 {
 {
 	public:
 	public:
 		/// Constructor
 		/// Constructor

+ 1 - 0
src/util/Util.h

@@ -32,4 +32,5 @@ extern Vec<std::string> getFileLines(const char* filename);
 
 
 }
 }
 
 
+
 #endif
 #endif