Skip to content
Snippets Groups Projects
Commit 995f93a9 authored by Robert Menzel's avatar Robert Menzel
Browse files
parents fd29e9c3 7fad840b
Branches
No related tags found
No related merge requests found
Showing
with 375 additions and 181 deletions
...@@ -18,15 +18,19 @@ ...@@ -18,15 +18,19 @@
#include <ACGL/Resource/NameManager.hh> #include <ACGL/Resource/NameManager.hh>
#include <ACGL/Resource/FileManager.hh> #include <ACGL/Resource/FileManager.hh>
#include <ACGL/OpenGL/Controller/ArrayBufferControl.hh>
#include <ACGL/OpenGL/Controller/ElementArrayBufferControl.hh>
#include <ACGL/OpenGL/Controller/FrameBufferObjectControl.hh>
#include <ACGL/OpenGL/Controller/RenderBufferControl.hh>
#include <ACGL/OpenGL/Controller/ShaderControlFile.hh> #include <ACGL/OpenGL/Controller/ShaderControlFile.hh>
#include <ACGL/OpenGL/Controller/ShaderProgramControlAutoFiles.hh> #include <ACGL/OpenGL/Controller/ShaderProgramControlAutoFiles.hh>
#include <ACGL/OpenGL/Controller/ShaderProgramObjectControl.hh>
#include <ACGL/OpenGL/Controller/StateControl.hh>
#include <ACGL/OpenGL/Controller/TextureControl.hh> #include <ACGL/OpenGL/Controller/TextureControl.hh>
#include <ACGL/OpenGL/Controller/TextureControlFileJPG.hh> #include <ACGL/OpenGL/Controller/TextureControlFileJPG.hh>
#include <ACGL/OpenGL/Controller/FrameBufferControl.hh> #include <ACGL/OpenGL/Controller/UniformControl.hh>
#include <ACGL/OpenGL/Controller/RenderBufferControl.hh> #include <ACGL/OpenGL/Controller/VertexBufferObjectControl.hh>
#include <ACGL/OpenGL/Controller/VertexBufferControl.hh> #include <ACGL/OpenGL/Controller/VertexBufferObjectControlFileOBJ.hh>
#include <ACGL/OpenGL/Controller/VertexBufferControlFileOBJ.hh> #include <ACGL/OpenGL/Controller/ViewportControl.hh>
#include <ACGL/OpenGL/Controller/ArrayBufferControl.hh>
#include <ACGL/OpenGL/Controller/ElementArrayBufferControl.hh>
#endif // ACGL_OPENGL_CONTROLLER_HH #endif // ACGL_OPENGL_CONTROLLER_HH
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
// All rights reserved. // // All rights reserved. //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#ifndef ACGL_OPENGL_CONTROLLER_FRAMEBUFFERCONTROL_HH #ifndef ACGL_OPENGL_CONTROLLER_FRAMEBUFFEROBJECTCONTROL_HH
#define ACGL_OPENGL_CONTROLLER_FRAMEBUFFERCONTROL_HH #define ACGL_OPENGL_CONTROLLER_FRAMEBUFFEROBJECTCONTROL_HH
#include <ACGL/ACGL.hh> #include <ACGL/ACGL.hh>
#include <ACGL/Resource/BasicCreateController.hh> #include <ACGL/Resource/BasicCreateController.hh>
#include <ACGL/OpenGL/Objects/FrameBuffer.hh> #include <ACGL/OpenGL/Objects/FrameBufferObject.hh>
#include <ACGL/OpenGL/GL.hh> #include <ACGL/OpenGL/GL.hh>
#include <ACGL/OpenGL/Objects/Texture.hh> #include <ACGL/OpenGL/Objects/Texture.hh>
...@@ -18,41 +18,38 @@ ...@@ -18,41 +18,38 @@
namespace ACGL{ namespace ACGL{
namespace OpenGL{ namespace OpenGL{
class FrameBufferControl : public Resource::BasicCreateController<FrameBuffer> class FrameBufferObjectControl : public Resource::BasicCreateController<FrameBufferObject>
{ {
// ========================================================================================================= \/ // ========================================================================================================= \/
// ============================================================================================ CONSTRUCTORS \/ // ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/ // ========================================================================================================= \/
public: public:
FrameBufferControl(void) FrameBufferObjectControl(void)
: mWidth(0), : mColorAttachments(),
mHeight(0),
mColorAttachments(),
mDepthAttachment() mDepthAttachment()
{ {
mDepthAttachment.name = ""; mDepthAttachment.name = "";
mDepthAttachment.texture = SharedTexture(); mDepthAttachment.texture = SharedTexture();
mDepthAttachment.renderBuffer = SharedRenderBuffer(); mDepthAttachment.renderBuffer = SharedRenderBuffer();
} }
virtual ~FrameBufferControl() {} virtual ~FrameBufferObjectControl() {}
// ==================================================================================================== \/ // ==================================================================================================== \/
// ============================================================================================ METHODS \/ // ============================================================================================ METHODS \/
// ==================================================================================================== \/ // ==================================================================================================== \/
public: public:
inline FrameBufferControl& size (GLsizei _width, GLsizei _height) { mWidth = _width; mHeight = _height; return *this; } inline FrameBufferObjectControl& depthTexture (const SharedTexture& _pDepthTexture) { mDepthAttachment.texture = _pDepthTexture; return *this; }
inline FrameBufferControl& depthTexture (const SharedTexture& _pDepthTexture) { mDepthAttachment.texture = _pDepthTexture; return *this; } inline FrameBufferObjectControl& depthRenderBuffer (const SharedRenderBuffer& _pDepthRenderBuffer) { mDepthAttachment.renderBuffer = _pDepthRenderBuffer; return *this; }
inline FrameBufferControl& depthRenderBuffer (const SharedRenderBuffer& _pDepthRenderBuffer) { mDepthAttachment.renderBuffer = _pDepthRenderBuffer; return *this; }
inline FrameBufferControl& colorTexture(const std::string& _name, const SharedTexture& _texture) inline FrameBufferObjectControl& colorTexture(const std::string& _name, const SharedTexture& _texture)
{ {
FrameBuffer::Attachment attachment = {_name, _texture, SharedRenderBuffer()}; FrameBufferObject::Attachment attachment = {_name, _texture, SharedRenderBuffer()};
mColorAttachments.push_back(attachment); mColorAttachments.push_back(attachment);
return *this; return *this;
} }
inline FrameBufferControl& colorRenderBuffer(const std::string& _name, const SharedRenderBuffer& _renderBuffer) inline FrameBufferObjectControl& colorRenderBuffer(const std::string& _name, const SharedRenderBuffer& _renderBuffer)
{ {
FrameBuffer::Attachment attachment = {_name, SharedTexture(), _renderBuffer}; FrameBufferObject::Attachment attachment = {_name, SharedTexture(), _renderBuffer};
mColorAttachments.push_back(attachment); mColorAttachments.push_back(attachment);
return *this; return *this;
} }
...@@ -61,16 +58,14 @@ public: ...@@ -61,16 +58,14 @@ public:
// ============================================================================================ OVERRIDE \/ // ============================================================================================ OVERRIDE \/
// ===================================================================================================== \/ // ===================================================================================================== \/
public: public:
virtual SharedFrameBuffer create (void); virtual SharedFrameBufferObject create (void);
// =================================================================================================== \/ // =================================================================================================== \/
// ============================================================================================ FIELDS \/ // ============================================================================================ FIELDS \/
// =================================================================================================== \/ // =================================================================================================== \/
protected: protected:
GLsizei mWidth; FrameBufferObject::AttachmentVec mColorAttachments;
GLsizei mHeight; FrameBufferObject::Attachment mDepthAttachment;
FrameBuffer::AttachmentVec mColorAttachments;
FrameBuffer::Attachment mDepthAttachment;
}; };
} // OpenGL } // OpenGL
......
...@@ -92,4 +92,4 @@ protected: ...@@ -92,4 +92,4 @@ protected:
} // OpenGL } // OpenGL
} // ACGL } // ACGL
#endif // ACGL_OPENGL_CONTROLLER_ShaderProgramObjectControl_HH #endif // ACGL_OPENGL_CONTROLLER_SHADERPROGRAMOBJECTCONTROL_HH
...@@ -15,20 +15,20 @@ ...@@ -15,20 +15,20 @@
namespace ACGL{ namespace ACGL{
namespace OpenGL{ namespace OpenGL{
class StateControl : public Resource::BasicCreateController<Texture> class StateControl : public Resource::BasicCreateController<State>
{ {
// ========================================================================================================= \/ // ========================================================================================================= \/
// ============================================================================================ CONSTRUCTORS \/ // ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/ // ========================================================================================================= \/
public: public:
StateControl( StateControl(
const ConstSharedVertexBuffer& _vertexBuffer, const ConstSharedVertexBufferObject& _vertexBufferObject,
const ConstSharedVertexBuffer& _frameBuffer, const ConstSharedFrameBufferObject& _frameBufferObject,
const ConstSharedVertexBuffer& _shaderProgram, const ConstSharedShaderProgramObject& _shaderProgramObject,
const ConstSharedVertexBuffer& _viewport) const ConstSharedViewport& _viewport)
: mpVertexBuffer(_vertexBuffer), : mpVertexBufferObject(_vertexBufferObject),
mpFrameBuffer(_frameBuffer), mpFrameBufferObject(_frameBufferObject),
mpShaderProgram(_shaderProgram), mpShaderProgramObject(_shaderProgramObject),
mpViewport(_viewport) mpViewport(_viewport)
{} {}
virtual ~StateControl(void) {} virtual ~StateControl(void) {}
...@@ -37,10 +37,10 @@ public: ...@@ -37,10 +37,10 @@ public:
// ============================================================================================ GETTERS \/ // ============================================================================================ GETTERS \/
// ==================================================================================================== \/ // ==================================================================================================== \/
public: public:
inline StateControl& vertexBuffer (const ConstSharedVertexBuffer& _vertexBuffer) { mpVertexBuffer = _vertexBuffer; return *this; } inline StateControl& vertexBufferObject (const ConstSharedVertexBufferObject& _vertexBufferObject) { mpVertexBufferObject = _vertexBufferObject; return *this; }
inline StateControl& frameBuffer (const ConstSharedFrameBuffer& _frameBuffer) { mpFrameBuffer = _frameBuffer; return *this; } inline StateControl& frameBufferObject (const ConstSharedFrameBufferObject& _frameBufferObject) { mpFrameBufferObject = _frameBufferObject; return *this; }
inline StateControl& shaderProgram (const ConstSharedShaderProgram& _shaderProgram) { mpShaderProgram = _shaderProgram; return *this; } inline StateControl& shaderProgramObject (const ConstSharedShaderProgramObject& _shaderProgramObject) { mpShaderProgramObject = _shaderProgramObject; return *this; }
inline StateControl& viewport (const ConstSharedShaderProgram& _viewport) { mpViewport = _viewport; return *this; } inline StateControl& viewport (const ConstSharedViewport& _viewport) { mpViewport = _viewport; return *this; }
// ===================================================================================================== \/ // ===================================================================================================== \/
// ============================================================================================ OVERRIDE \/ // ============================================================================================ OVERRIDE \/
...@@ -48,7 +48,7 @@ public: ...@@ -48,7 +48,7 @@ public:
public: public:
virtual SharedState create(void) virtual SharedState create(void)
{ {
SharedState state(new State(mpVertexBuffer, mpFrameBuffer, mpShaderProgram, mpViewport)); SharedState state(new State(mpVertexBufferObject, mpFrameBufferObject, mpShaderProgramObject, mpViewport));
return state; return state;
} }
...@@ -57,9 +57,9 @@ public: ...@@ -57,9 +57,9 @@ public:
// ============================================================================================ FIELDS \/ // ============================================================================================ FIELDS \/
// =================================================================================================== \/ // =================================================================================================== \/
protected: protected:
ConstSharedVertexBuffer mpVertexBuffer; ConstSharedVertexBufferObject mpVertexBufferObject;
ConstSharedFrameBuffer mpFrameBuffer; ConstSharedFrameBufferObject mpFrameBufferObject;
ConstSharedShaderProgram mpShaderProgram; ConstSharedShaderProgramObject mpShaderProgramObject;
ConstSharedViewport mpViewport; ConstSharedViewport mpViewport;
}; };
......
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2011, Computer Graphics Group RWTH Aachen University //
// All rights reserved. //
////////////////////////////////////////////////////////////////////////////////
#ifndef ACGL_OPENGL_CONTROLLER_UNIFORMCONTROL_HH
#define ACGL_OPENGL_CONTROLLER_UNIFORMCONTROL_HH
#include <ACGL/ACGL.hh>
#include <ACGL/Resource/BasicCreateController.hh>
#include <ACGL/OpenGL/Objects/Uniform.hh>
#include <ACGL/OpenGL/GL.hh>
namespace ACGL{
namespace OpenGL{
template<class UNIFORM>
class UniformControl : public Resource::BasicCreateController<UNIFORM>
{
// ========================================================================================================= \/
// ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/
public:
UniformControl(const typename UNIFORM::DATA_TYPE& _value)
: mValue(_value)
{}
virtual ~UniformControl() {}
// ==================================================================================================== \/
// ============================================================================================ METHODS \/
// ==================================================================================================== \/
public:
inline UniformControl& value (const typename UNIFORM::DATA_TYPE& _value) { mValue = _value; return *this; }
// ===================================================================================================== \/
// ============================================================================================ OVERRIDE \/
// ===================================================================================================== \/
public:
virtual std::tr1::shared_ptr<UNIFORM> create(void)
{
std::tr1::shared_ptr<UNIFORM> uniform(new UNIFORM());
uniform->setValue(mValue);
return uniform;
}
// =================================================================================================== \/
// ============================================================================================ FIELDS \/
// =================================================================================================== \/
protected:
typename UNIFORM::DATA_TYPE mValue;
};
typedef UniformControl<Uniform1i> Uniform1iControl;
typedef UniformControl<Uniform1f> Uniform1fControl;
typedef UniformControl<Uniform2f> Uniform2fControl;
typedef UniformControl<Uniform3f> Uniform3fControl;
typedef UniformControl<Uniform4f> Uniform4fControl;
typedef UniformControl<UniformMatrix2f> UniformMatrix2fControl;
typedef UniformControl<UniformMatrix3f> UniformMatrix3fControl;
typedef UniformControl<UniformMatrix4f> UniformMatrix4fControl;
typedef UniformControl<UniformTexture> UniformTextureControl;
} // OpenGL
} // ACGL
#endif // ACGL_OPENGL_CONTROLLER_ARRAYBUFFERCONTROL_HH
...@@ -3,19 +3,19 @@ ...@@ -3,19 +3,19 @@
// All rights reserved. // // All rights reserved. //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#ifndef ACGL_OPENGL_CONTROLLER_VERTEXBUFFERCONTROL_HH #ifndef ACGL_OPENGL_CONTROLLER_VERTEXBUFFEROBJECTCONTROL_HH
#define ACGL_OPENGL_CONTROLLER_VERTEXBUFFERCONTROL_HH #define ACGL_OPENGL_CONTROLLER_VERTEXBUFFEROBJECTCONTROL_HH
#include <ACGL/ACGL.hh> #include <ACGL/ACGL.hh>
#include <ACGL/Resource/BasicCreateController.hh> #include <ACGL/Resource/BasicCreateController.hh>
#include <ACGL/OpenGL/Objects/VertexBuffer.hh> #include <ACGL/OpenGL/Objects/VertexBufferObject.hh>
#include <ACGL/OpenGL/GL.hh> #include <ACGL/OpenGL/GL.hh>
namespace ACGL{ namespace ACGL{
namespace OpenGL{ namespace OpenGL{
class VertexBufferControl : public Resource::BasicCreateController<VertexBuffer> class VertexBufferObjectControl : public Resource::BasicCreateController<VertexBufferObject>
{ {
// ==================================================================================================== \/ // ==================================================================================================== \/
// ============================================================================================ STRUCTS \/ // ============================================================================================ STRUCTS \/
...@@ -38,29 +38,29 @@ public: ...@@ -38,29 +38,29 @@ public:
// ============================================================================================ CONSTRUCTORS \/ // ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/ // ========================================================================================================= \/
public: public:
VertexBufferControl(void) VertexBufferObjectControl(void)
: Resource::BasicCreateController<VertexBuffer>(), : Resource::BasicCreateController<VertexBufferObject>(),
mpElementArrayBuffer(), mpElementArrayBuffer(),
mArrayBuffers(), mArrayBuffers(),
mAttributeDefines() mAttributeDefines()
{} {}
virtual ~VertexBufferControl() {} virtual ~VertexBufferObjectControl() {}
// ==================================================================================================== \/ // ==================================================================================================== \/
// ============================================================================================ METHODS \/ // ============================================================================================ METHODS \/
// ==================================================================================================== \/ // ==================================================================================================== \/
public: public:
inline VertexBufferControl& index (const SharedElementArrayBuffer& _elementArrayBuffer) { mpElementArrayBuffer = _elementArrayBuffer; return *this; } inline VertexBufferObjectControl& index (const SharedElementArrayBuffer& _elementArrayBuffer) { mpElementArrayBuffer = _elementArrayBuffer; return *this; }
inline VertexBufferControl& data (const SharedArrayBuffer& _vertexBuffer) { mArrayBuffers.push_back(_vertexBuffer); return *this; } inline VertexBufferObjectControl& data (const SharedArrayBuffer& _vertexBuffer) { mArrayBuffers.push_back(_vertexBuffer); return *this; }
inline VertexBufferControl& attribute (const std::string& _name, const std::string& _nameInArray) inline VertexBufferObjectControl& attribute (const std::string& _name, const std::string& _nameInArray)
{ {
AttributeDefine a = {_name, mArrayBuffers.size()-1, _nameInArray}; AttributeDefine a = {_name, mArrayBuffers.size()-1, _nameInArray};
mAttributeDefines.push_back(a); mAttributeDefines.push_back(a);
return *this; return *this;
} }
inline VertexBufferControl& attribute (const std::string& _name, int_t _bufferID, const std::string& _nameInArray) inline VertexBufferObjectControl& attribute (const std::string& _name, int_t _bufferID, const std::string& _nameInArray)
{ {
AttributeDefine a = {_name, _bufferID, _nameInArray}; AttributeDefine a = {_name, _bufferID, _nameInArray};
mAttributeDefines.push_back(a); mAttributeDefines.push_back(a);
...@@ -71,18 +71,18 @@ public: ...@@ -71,18 +71,18 @@ public:
// ============================================================================================ OVERRIDE \/ // ============================================================================================ OVERRIDE \/
// ===================================================================================================== \/ // ===================================================================================================== \/
public: public:
virtual SharedVertexBuffer create(void); virtual SharedVertexBufferObject create(void);
// =================================================================================================== \/ // =================================================================================================== \/
// ============================================================================================ FIELDS \/ // ============================================================================================ FIELDS \/
// =================================================================================================== \/ // =================================================================================================== \/
protected: protected:
SharedElementArrayBuffer mpElementArrayBuffer; SharedElementArrayBuffer mpElementArrayBuffer;
VertexBuffer::ArrayBufferVec mArrayBuffers; VertexBufferObject::ArrayBufferVec mArrayBuffers;
AttributeDefineVec mAttributeDefines; AttributeDefineVec mAttributeDefines;
}; };
} // OpenGL } // OpenGL
} // ACGL } // ACGL
#endif // ACGL_OPENGL_CONTROLLER_VERTEXBUFFERCONTROL_HH #endif // ACGL_OPENGL_CONTROLLER_VERTEXBUFFEROBJECTCONTROL_HH
...@@ -3,42 +3,42 @@ ...@@ -3,42 +3,42 @@
// All rights reserved. // // All rights reserved. //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#ifndef ACGL_OPENGL_CONTROLLER_VERTEXBUFFERCONTROLFILEOBJ_HH #ifndef ACGL_OPENGL_CONTROLLER_VERTEXBUFFEROBJECTCONTROLFILEOBJ_HH
#define ACGL_OPENGL_CONTROLLER_VERTEXBUFFERCONTROLFILEOBJ_HH #define ACGL_OPENGL_CONTROLLER_VERTEXBUFFEROBJECTCONTROLFILEOBJ_HH
#include <ACGL/ACGL.hh> #include <ACGL/ACGL.hh>
#include <ACGL/Resource/FileController.hh> #include <ACGL/Resource/FileController.hh>
#include <ACGL/Base/Settings.hh> #include <ACGL/Base/Settings.hh>
#include <ACGL/OpenGL/Objects/VertexBuffer.hh> #include <ACGL/OpenGL/Objects/VertexBufferObject.hh>
#include <ACGL/OpenGL/GL.hh> #include <ACGL/OpenGL/GL.hh>
namespace ACGL{ namespace ACGL{
namespace OpenGL{ namespace OpenGL{
class VertexBufferControlFileOBJ : public Resource::FileController<VertexBuffer> class VertexBufferObjectControlFileOBJ : public Resource::FileController<VertexBufferObject>
{ {
// ========================================================================================================= \/ // ========================================================================================================= \/
// ============================================================================================ CONSTRUCTORS \/ // ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/ // ========================================================================================================= \/
public: public:
VertexBufferControlFileOBJ(const std::string& _filename) VertexBufferObjectControlFileOBJ(const std::string& _filename)
: Resource::FileController<VertexBuffer>(_filename, Base::Settings::the()->getFullGeometryPath()) : Resource::FileController<VertexBufferObject>(_filename, Base::Settings::the()->getFullGeometryPath())
{} {}
virtual ~VertexBufferControlFileOBJ() {} virtual ~VertexBufferObjectControlFileOBJ() {}
private: private:
bool loadOBJ(SharedVertexBuffer& vertexBuffer); bool loadOBJ(SharedVertexBufferObject& vertexBuffer);
// ===================================================================================================== \/ // ===================================================================================================== \/
// ============================================================================================ OVERRIDE \/ // ============================================================================================ OVERRIDE \/
// ===================================================================================================== \/ // ===================================================================================================== \/
public: public:
virtual SharedVertexBuffer create(void); virtual SharedVertexBufferObject create(void);
virtual bool update(SharedVertexBuffer& vertexBuffer); virtual bool update(SharedVertexBufferObject& vertexBuffer);
}; };
} // OpenGL } // OpenGL
} // ACGL } // ACGL
#endif // ACGL_OPENGL_CONTROLLER_VERTEXBUFFERCONTROLFILEOBJ_HH #endif // ACGL_OPENGL_CONTROLLER_VERTEXBUFFEROBJECTCONTROLFILEOBJ_HH
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2011, Computer Graphics Group RWTH Aachen University //
// All rights reserved. //
////////////////////////////////////////////////////////////////////////////////
#ifndef ACGL_OPENGL_CONTROLLER_VIEWPORTCONTROL_HH
#define ACGL_OPENGL_CONTROLLER_VIEWPORTCONTROL_HH
#include <ACGL/ACGL.hh>
#include <ACGL/Resource/BasicCreateController.hh>
#include <ACGL/OpenGL/Objects/State.hh>
#include <ACGL/OpenGL/GL.hh>
namespace ACGL{
namespace OpenGL{
class ViewportControl : public Resource::BasicCreateController<Viewport>
{
// ========================================================================================================= \/
// ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/
public:
ViewportControl()
: mOffsetX(0),
mOffsetY(0),
mWidth(0),
mHeight(0)
{}
virtual ~ViewportControl(void) {}
// ==================================================================================================== \/
// ============================================================================================ GETTERS \/
// ==================================================================================================== \/
public:
inline ViewportControl& offset (GLint _offsetX, GLint _offsetY)
{
mOffsetX = _offsetX;
mOffsetY = _offsetY;
return *this;
}
inline ViewportControl& size (GLsizei _width, GLsizei _height)
{
mOffsetX = _width;
mOffsetY = _height;
return *this;
}
// ===================================================================================================== \/
// ============================================================================================ OVERRIDE \/
// ===================================================================================================== \/
public:
virtual SharedViewport create(void)
{
SharedViewport viewport(new Viewport(mOffsetX, mOffsetY, mWidth, mHeight));
return viewport;
}
// =================================================================================================== \/
// ============================================================================================ FIELDS \/
// =================================================================================================== \/
protected:
GLint mOffsetX;
GLint mOffsetY;
GLsizei mWidth;
GLsizei mHeight;
};
} // OpenGL
} // ACGL
#endif // ACGL_OPENGL_CONTROLLER_TEXTURECONTROL_HH
...@@ -21,25 +21,40 @@ ...@@ -21,25 +21,40 @@
namespace ACGL{ namespace ACGL{
namespace OpenGL{ namespace OpenGL{
typedef Resource::NameManager<ArrayBuffer> ArrayBufferNameManager;
typedef Resource::NameManager<ElementArrayBuffer> ElementArrayBufferNameManager;
typedef Resource::NameManager<FrameBufferObject> FrameBufferObjectNameManager;
typedef Resource::NameManager<RenderBuffer> RenderBufferNameManager;
typedef Resource::NameManager<Shader> ShaderNameManager; typedef Resource::NameManager<Shader> ShaderNameManager;
typedef Resource::FileManager<Shader> ShaderFileManager; typedef Resource::FileManager<Shader> ShaderFileManager;
typedef Resource::NameManager<ShaderProgram> ShaderProgramNameManager; typedef Resource::NameManager<ShaderProgram> ShaderProgramNameManager;
typedef Resource::FileManager<ShaderProgram> ShaderProgramFileManager; typedef Resource::FileManager<ShaderProgram> ShaderProgramFileManager;
typedef Resource::NameManager<Texture> TextureNameManager; typedef Resource::NameManager<ShaderProgramObject> ShaderProgramObjectNameManager;
typedef Resource::FileManager<Texture> TextureFileManager;
typedef Resource::NameManager<FrameBuffer> FrameBufferNameManager; typedef Resource::NameManager<State> StateNameManager;
typedef Resource::NameManager<RenderBuffer> RenderBufferNameManager; typedef Resource::NameManager<Texture> TextureNameManager;
typedef Resource::FileManager<Texture> TextureFileManager;
typedef Resource::NameManager<VertexBuffer> VertexBufferNameManager; typedef Resource::NameManager<Uniform1f> Uniform1fNameManager;
typedef Resource::FileManager<VertexBuffer> VertexBufferFileManager; typedef Resource::NameManager<Uniform2f> Uniform2fNameManager;
typedef Resource::NameManager<Uniform3f> Uniform3fNameManager;
typedef Resource::NameManager<Uniform4f> Uniform4fNameManager;
typedef Resource::NameManager<UniformMatrix2f> UniformMatrix2fNameManager;
typedef Resource::NameManager<UniformMatrix3f> UniformMatrix3fNameManager;
typedef Resource::NameManager<UniformMatrix4f> UniformMatrix4fNameManager;
typedef Resource::NameManager<UniformTexture> UniformTextureNameManager;
typedef Resource::NameManager<ArrayBuffer> ArrayBufferNameManager; typedef Resource::NameManager<VertexBufferObject> VertexBufferObjectNameManager;
typedef Resource::FileManager<VertexBufferObject> VertexBufferObjectFileManager;
typedef Resource::NameManager<ElementArrayBuffer> ElementArrayBufferNameManager; typedef Resource::NameManager<Viewport> ViewportNameManager;
} // OpenGL } // OpenGL
} // ACGL } // ACGL
......
...@@ -12,14 +12,18 @@ ...@@ -12,14 +12,18 @@
#include <ACGL/ACGL.hh> #include <ACGL/ACGL.hh>
#include <ACGL/OpenGL/Objects/ArrayBuffer.hh>
#include <ACGL/OpenGL/Objects/ElementArrayBuffer.hh>
#include <ACGL/OpenGL/Objects/FrameBufferObject.hh>
#include <ACGL/OpenGL/Objects/RenderBuffer.hh>
#include <ACGL/OpenGL/Objects/Shader.hh> #include <ACGL/OpenGL/Objects/Shader.hh>
#include <ACGL/OpenGL/Objects/ShaderProgram.hh> #include <ACGL/OpenGL/Objects/ShaderProgram.hh>
#include <ACGL/OpenGL/Objects/ShaderProgramObject.hh>
#include <ACGL/OpenGL/Objects/State.hh>
#include <ACGL/OpenGL/Objects/Texture.hh> #include <ACGL/OpenGL/Objects/Texture.hh>
#include <ACGL/OpenGL/Objects/FrameBuffer.hh> #include <ACGL/OpenGL/Objects/Uniform.hh>
#include <ACGL/OpenGL/Objects/RenderBuffer.hh> #include <ACGL/OpenGL/Objects/VertexBufferObject.hh>
#include <ACGL/OpenGL/Objects/VertexBuffer.hh> #include <ACGL/OpenGL/Objects/Viewport.hh>
#include <ACGL/OpenGL/Objects/ArrayBuffer.hh>
#include <ACGL/OpenGL/Objects/ElementArrayBuffer.hh>
#endif // ACGL_OPENGL_OBJECTS_HH #endif // ACGL_OPENGL_OBJECTS_HH
...@@ -3,18 +3,18 @@ ...@@ -3,18 +3,18 @@
// All rights reserved. // // All rights reserved. //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#ifndef ACGL_OPENGL_OBJECTS_FRAMEBUFFER_HH #ifndef ACGL_OPENGL_OBJECTS_FRAMEBUFFEROBJECT_HH
#define ACGL_OPENGL_OBJECTS_FRAMEBUFFER_HH #define ACGL_OPENGL_OBJECTS_FRAMEBUFFEROBJECT_HH
/* /*
* This FrameBuffer class encapsulates an OpenGL frame buffer object (FBO). * This FrameBufferObject class encapsulates an OpenGL frame buffer object (FBO).
* A FrameBuffer is a target for rendering and thus consists of different "layers": * A FrameBufferObject is a target for rendering and thus consists of different "layers":
* *
* one or no depthbuffer * one or no depthbuffer
* one or no stencilbuffer * one or no stencilbuffer
* one (OpenGL ES) to many (hardware dependent limit) colorbuffers * one (OpenGL ES) to many (hardware dependent limit) colorbuffers
* *
* These buffers get attached to the FrameBuffer. * These buffers get attached to the FrameBufferObject.
* *
* There exists one system-provided frame buffer object for rendering to the screen * There exists one system-provided frame buffer object for rendering to the screen
* and optionaly multiple user defined frame buffer objects for offscreen rendering. * and optionaly multiple user defined frame buffer objects for offscreen rendering.
...@@ -37,9 +37,9 @@ ...@@ -37,9 +37,9 @@
namespace ACGL{ namespace ACGL{
namespace OpenGL{ namespace OpenGL{
class FrameBuffer class FrameBufferObject
{ {
ACGL_NOT_COPYABLE(FrameBuffer) ACGL_NOT_COPYABLE(FrameBufferObject)
// =================================================================================================== \/ // =================================================================================================== \/
// ============================================================================================ STATIC \/ // ============================================================================================ STATIC \/
...@@ -69,7 +69,7 @@ public: ...@@ -69,7 +69,7 @@ public:
// ============================================================================================ CONSTRUCTORS \/ // ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/ // ========================================================================================================= \/
public: public:
FrameBuffer(GLsizei _width, GLsizei _height) FrameBufferObject(void)
: mContext(0), : mContext(0),
mDrawBuffers(0), mDrawBuffers(0),
mColorAttachments(), mColorAttachments(),
...@@ -77,7 +77,7 @@ public: ...@@ -77,7 +77,7 @@ public:
{ {
glGenFramebuffers(1, &mContext); glGenFramebuffers(1, &mContext);
if (openGLCriticalErrorOccured() ) { if (openGLCriticalErrorOccured() ) {
ACGL::Utils::error() << "could not generate framebuffer!" << std::endl; ACGL::Utils::error() << "could not generate FrameBufferObject!" << std::endl;
return; return;
} }
mDepthAttachment.name = ""; mDepthAttachment.name = "";
...@@ -85,7 +85,7 @@ public: ...@@ -85,7 +85,7 @@ public:
mDepthAttachment.renderBuffer = SharedRenderBuffer(); mDepthAttachment.renderBuffer = SharedRenderBuffer();
} }
virtual ~FrameBuffer(void) virtual ~FrameBufferObject(void)
{ {
// buffer 0 will get ignored by OpenGL // buffer 0 will get ignored by OpenGL
glDeleteFramebuffers(1, &mContext); glDeleteFramebuffers(1, &mContext);
...@@ -108,8 +108,8 @@ public: ...@@ -108,8 +108,8 @@ public:
void validate (void) const; void validate (void) const;
/** /**
* Per default a FrameBuffer gets used for read/write operations, but we can * Per default a FrameBufferObject gets used for read/write operations, but we can
* bind two different FrameBuffers for these operations! * bind two different FrameBufferObjects for these operations!
*/ */
inline void bind(GLenum _type = GL_FRAMEBUFFER) const inline void bind(GLenum _type = GL_FRAMEBUFFER) const
{ {
...@@ -131,11 +131,11 @@ public: ...@@ -131,11 +131,11 @@ public:
openGLRareError(); openGLRareError();
} }
inline bool isFrameBufferComplete(void) const inline bool isFrameBufferObjectComplete(void) const
{ {
if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
{ {
Utils::error() << "Failed to make complete FrameBuffer object: " << (glCheckFramebufferStatus(GL_FRAMEBUFFER)) << std::endl; Utils::error() << "Failed to make complete FrameBufferObject object: " << (glCheckFramebufferStatus(GL_FRAMEBUFFER)) << std::endl;
return false; return false;
} }
return true; return true;
...@@ -209,9 +209,9 @@ protected: ...@@ -209,9 +209,9 @@ protected:
Attachment mDepthAttachment; // depth and stencil are combined Attachment mDepthAttachment; // depth and stencil are combined
}; };
ACGL_SHARED_TYPEDEF(FrameBuffer) ACGL_SHARED_TYPEDEF(FrameBufferObject)
} // OpenGL } // OpenGL
} // ACGL } // ACGL
#endif // ACGL_OPENGL_OBJECTS_FRAMEBUFFER_HH #endif // ACGL_OPENGL_OBJECTS_FRAMEBUFFEROBJECT_HH
...@@ -26,8 +26,8 @@ class Shader ...@@ -26,8 +26,8 @@ class Shader
// ============================================================================================ TYPEDEFS \/ // ============================================================================================ TYPEDEFS \/
// ===================================================================================================== \/ // ===================================================================================================== \/
public: public:
typedef std::vector<std::string> AttributeVec; typedef std::vector<std::string> AttributeNameVec;
typedef std::vector<std::string> FragmentDataVec; typedef std::vector<std::string> FragmentDataNameVec;
// ========================================================================================================= \/ // ========================================================================================================= \/
// ============================================================================================ CONSTRUCTORS \/ // ============================================================================================ CONSTRUCTORS \/
...@@ -53,8 +53,9 @@ public: ...@@ -53,8 +53,9 @@ public:
inline GLuint getContext (void) const { return mContext; } inline GLuint getContext (void) const { return mContext; }
inline GLenum getType (void) const { return mType; } inline GLenum getType (void) const { return mType; }
inline const std::vector<std::string>& getAttributes() const { return mAttributes; } inline const std::vector<std::string>& getAttributeNames (void) const { return mAttributeNames; }
inline const std::vector<std::string>& getFragmentData() const { return mFragmentData; } inline const std::vector<std::string>& getFragmentDataNames (void) const { return mFragmentDataNames; }
// ==================================================================================================== \/ // ==================================================================================================== \/
// ============================================================================================ METHODS \/ // ============================================================================================ METHODS \/
// ==================================================================================================== \/ // ==================================================================================================== \/
...@@ -71,8 +72,8 @@ protected: ...@@ -71,8 +72,8 @@ protected:
protected: protected:
GLuint mContext; GLuint mContext;
GLenum mType; GLenum mType;
AttributeVec mAttributes; AttributeNameVec mAttributeNames;
FragmentDataVec mFragmentData; FragmentDataNameVec mFragmentDataNames;
}; };
ACGL_SHARED_TYPEDEF(Shader) ACGL_SHARED_TYPEDEF(Shader)
......
...@@ -105,4 +105,4 @@ ACGL_SHARED_TYPEDEF(ShaderProgramObject) ...@@ -105,4 +105,4 @@ ACGL_SHARED_TYPEDEF(ShaderProgramObject)
} // OpenGL } // OpenGL
} // ACGL } // ACGL
#endif // ACGL_OPENGL_OBJECTS_ShaderProgramObject_HH #endif // ACGL_OPENGL_OBJECTS_SHADERPROGRAMOBJECT_HH
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
#include <ACGL/Base/Macros.hh> #include <ACGL/Base/Macros.hh>
#include <ACGL/OpenGL/GL.hh> #include <ACGL/OpenGL/GL.hh>
#include <ACGL/OpenGL/Objects/VertexBuffer.hh> #include <ACGL/OpenGL/Objects/VertexBufferObject.hh>
#include <ACGL/OpenGL/Objects/FrameBuffer.hh> #include <ACGL/OpenGL/Objects/FrameBufferObject.hh>
#include <ACGL/OpenGL/Objects/ShaderProgram.hh> #include <ACGL/OpenGL/Objects/ShaderProgramObject.hh>
#include <ACGL/OpenGL/Objects/Viewport.hh> #include <ACGL/OpenGL/Objects/Viewport.hh>
namespace ACGL{ namespace ACGL{
...@@ -33,15 +33,15 @@ class State ...@@ -33,15 +33,15 @@ class State
private: private:
struct AttributeMapping struct AttributeMapping
{ {
int arrayBufferID; int_t arrayBufferID;
int vertexBufferAttribute; int_t vertexBufferObjectAttribute;
int shaderProgramAttribute; int_t shaderProgramAttributeLocation;
}; };
struct FragmentDataMapping struct FragmentDataMapping
{ {
int frameBufferColorAttachment; int_t frameBufferObjectColorAttachment;
int shaderProgramFragmentData; int_t shaderProgramFragmentDataLocation;
}; };
// ===================================================================================================== \/ // ===================================================================================================== \/
// ============================================================================================ TYPEDEFS \/ // ============================================================================================ TYPEDEFS \/
...@@ -54,13 +54,13 @@ private: ...@@ -54,13 +54,13 @@ private:
// ============================================================================================ CONSTRUCTORS \/ // ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/ // ========================================================================================================= \/
public: public:
State(ConstSharedVertexBuffer _vertexBuffer, State(ConstSharedVertexBufferObject _vertexBufferObject,
ConstSharedFrameBuffer _frameBuffer, ConstSharedFrameBufferObject _frameBufferObject,
ConstSharedShaderProgram _shaderProgram, ConstSharedShaderProgramObject _shaderProgram,
ConstSharedViewport _viewport) ConstSharedViewport _viewport)
: mpVertexBuffer(_vertexBuffer), : mpVertexBufferObject(_vertexBufferObject),
mpFrameBuffer(_frameBuffer), mpFrameBufferObject(_frameBufferObject),
mpShaderProgram(_shaderProgram), mpShaderProgramObject(_shaderProgram),
mpViewport(_viewport), mpViewport(_viewport),
mAttributeMappings(), mAttributeMappings(),
mFragmentDataMappings(), mFragmentDataMappings(),
...@@ -79,35 +79,51 @@ public: ...@@ -79,35 +79,51 @@ public:
// ============================================================================================ GETTERS \/ // ============================================================================================ GETTERS \/
// ==================================================================================================== \/ // ==================================================================================================== \/
public: public:
inline ConstSharedVertexBuffer getVertexBuffer (void) const { return mpVertexBuffer; } inline ConstSharedVertexBufferObject getVertexBufferObject (void) const { return mpVertexBufferObject; }
inline ConstSharedFrameBuffer getFrameBuffer (void) const { return mpFrameBuffer; } inline ConstSharedFrameBufferObject getFrameBufferObject (void) const { return mpFrameBufferObject; }
inline ConstSharedShaderProgram getShaderProgram (void) const { return mpShaderProgram; } inline ConstSharedShaderProgramObject getShaderProgramObject (void) const { return mpShaderProgramObject; }
inline ConstSharedViewport getViewport (void) const { return mpViewport; } inline ConstSharedViewport getViewport (void) const { return mpViewport; }
// ==================================================================================================== \/ // ==================================================================================================== \/
// ============================================================================================ METHODS \/ // ============================================================================================ METHODS \/
// ==================================================================================================== \/ // ==================================================================================================== \/
public: public:
void updateMappings (void);
void useViewport (void) const;
void useShaderProgramObject (void) const;
void bindFrameBufferObject (void) const;
void enableVertexBufferObject (void) const;
void disableVertexBufferObject (void) const;
inline void validate (void) const inline void validate (void) const
{ {
mpFrameBuffer->validate(); mpFrameBufferObject->validate();
mpVertexBuffer->validate(); mpVertexBufferObject->validate();
} }
void useViewport (void); inline void draw(void) const
void enableVertexBuffer (void); {
void bindFrameBuffer (void); mpVertexBufferObject->draw();
void disableVertexBuffer (void); }
void updateMappings (void);
void render (void); inline void render(void) const
{
useViewport();
useShaderProgramObject();
bindFrameBufferObject();
enableVertexBufferObject();
draw();
disableVertexBufferObject();
}
// =================================================================================================== \/ // =================================================================================================== \/
// ============================================================================================ FIELDS \/ // ============================================================================================ FIELDS \/
// =================================================================================================== \/ // =================================================================================================== \/
protected: protected:
ConstSharedVertexBuffer mpVertexBuffer; ConstSharedVertexBufferObject mpVertexBufferObject;
ConstSharedFrameBuffer mpFrameBuffer; ConstSharedFrameBufferObject mpFrameBufferObject;
ConstSharedShaderProgram mpShaderProgram; ConstSharedShaderProgramObject mpShaderProgramObject;
ConstSharedViewport mpViewport; ConstSharedViewport mpViewport;
AttributeMappingVec mAttributeMappings; AttributeMappingVec mAttributeMappings;
......
...@@ -36,6 +36,12 @@ ACGL_SHARED_TYPEDEF(Uniform) ...@@ -36,6 +36,12 @@ ACGL_SHARED_TYPEDEF(Uniform)
template<typename T> template<typename T>
class UniformData class UniformData
{ {
// ===================================================================================================== \/
// ============================================================================================ TYPEDEFS \/
// ===================================================================================================== \/
public:
typedef T DATA_TYPE;
// ========================================================================================================= \/ // ========================================================================================================= \/
// ============================================================================================ CONSTRUCTORS \/ // ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/ // ========================================================================================================= \/
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
// All rights reserved. // // All rights reserved. //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#ifndef ACGL_OPENGL_OBJECTS_VERTEXBUFFER_HH #ifndef ACGL_OPENGL_OBJECTS_VERTEXBUFFEROBJECT_HH
#define ACGL_OPENGL_OBJECTS_VERTEXBUFFER_HH #define ACGL_OPENGL_OBJECTS_VERTEXBUFFEROBJECT_HH
#include <ACGL/ACGL.hh> #include <ACGL/ACGL.hh>
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
namespace ACGL{ namespace ACGL{
namespace OpenGL{ namespace OpenGL{
class VertexBuffer class VertexBufferObject
{ {
ACGL_NOT_COPYABLE(VertexBuffer) ACGL_NOT_COPYABLE(VertexBufferObject)
// ==================================================================================================== \/ // ==================================================================================================== \/
// ============================================================================================ STRUCTS \/ // ============================================================================================ STRUCTS \/
...@@ -45,13 +45,13 @@ public: ...@@ -45,13 +45,13 @@ public:
// ============================================================================================ CONSTRUCTORS \/ // ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/ // ========================================================================================================= \/
public: public:
VertexBuffer(void) VertexBufferObject(void)
: mpElementArrayBuffer(), : mpElementArrayBuffer(),
mArrayBuffers(), mArrayBuffers(),
mAttributes() mAttributes()
{} {}
virtual ~VertexBuffer(void) {}; virtual ~VertexBufferObject(void) {};
// ==================================================================================================== \/ // ==================================================================================================== \/
// ============================================================================================ GETTERS \/ // ============================================================================================ GETTERS \/
...@@ -158,9 +158,9 @@ protected: ...@@ -158,9 +158,9 @@ protected:
AttributeVec mAttributes; AttributeVec mAttributes;
}; };
ACGL_SHARED_TYPEDEF(VertexBuffer) ACGL_SHARED_TYPEDEF(VertexBufferObject)
} // OpenGL } // OpenGL
} // ACGL } // ACGL
#endif // ACGL_OPENGL_OBJECTS_VERTEXBUFFER_HH #endif // ACGL_OPENGL_OBJECTS_VERTEXBUFFEROBJECT_HH
...@@ -27,10 +27,10 @@ class Viewport ...@@ -27,10 +27,10 @@ class Viewport
// ============================================================================================ CONSTRUCTORS \/ // ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/ // ========================================================================================================= \/
public: public:
Viewport(int _offsetX, Viewport(GLint _offsetX = 0,
int _offsetY, GLint _offsetY = 0,
int _width, GLsizei _width = 0,
int _height) GLsizei _height = 0)
: mOffsetX(_offsetX), : mOffsetX(_offsetX),
mOffsetY(_offsetY), mOffsetY(_offsetY),
mWidth(_width), mWidth(_width),
...@@ -43,10 +43,10 @@ public: ...@@ -43,10 +43,10 @@ public:
// ============================================================================================ GETTERS \/ // ============================================================================================ GETTERS \/
// ==================================================================================================== \/ // ==================================================================================================== \/
public: public:
inline int getOffsetX (void) const { return mOffsetX; } inline GLint getOffsetX (void) const { return mOffsetX; }
inline int getOffsetY (void) const { return mOffsetY; } inline GLint getOffsetY (void) const { return mOffsetY; }
inline int getWidth (void) const { return mWidth; } inline GLsizei getWidth (void) const { return mWidth; }
inline int getHeight (void) const { return mHeight; } inline GLsizei getHeight (void) const { return mHeight; }
// ==================================================================================================== \/ // ==================================================================================================== \/
// ============================================================================================ METHODS \/ // ============================================================================================ METHODS \/
...@@ -57,14 +57,26 @@ public: ...@@ -57,14 +57,26 @@ public:
glViewport(mOffsetX, mOffsetY, mWidth, mHeight); glViewport(mOffsetX, mOffsetY, mWidth, mHeight);
} }
inline void setOffset (GLint _offsetX, GLint _offsetY)
{
mOffsetX = _offsetX;
mOffsetY = _offsetY;
}
inline void setSize (GLsizei _width, GLsizei _height)
{
mWidth = _width;
mHeight = _height;
}
// =================================================================================================== \/ // =================================================================================================== \/
// ============================================================================================ FIELDS \/ // ============================================================================================ FIELDS \/
// =================================================================================================== \/ // =================================================================================================== \/
protected: protected:
int mOffsetX; GLint mOffsetX;
int mOffsetY; GLint mOffsetY;
int mWidth; GLsizei mWidth;
int mHeight; GLsizei mHeight;
}; };
ACGL_SHARED_TYPEDEF(Viewport) ACGL_SHARED_TYPEDEF(Viewport)
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
// All rights reserved. // // All rights reserved. //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#include <ACGL/OpenGL/Controller/FrameBufferControl.hh> #include <ACGL/OpenGL/Controller/FrameBufferObjectControl.hh>
using namespace ACGL::OpenGL; using namespace ACGL::OpenGL;
SharedFrameBuffer FrameBufferControl::create(void) SharedFrameBufferObject FrameBufferObjectControl::create(void)
{ {
SharedFrameBuffer frameBuffer(new FrameBuffer(mWidth, mHeight)); SharedFrameBufferObject frameBuffer(new FrameBufferObject());
frameBuffer->bind(); frameBuffer->bind();
for(FrameBuffer::AttachmentVec::size_type i = 0; i < mColorAttachments.size(); ++i) for(FrameBufferObject::AttachmentVec::size_type i = 0; i < mColorAttachments.size(); ++i)
{ {
if(mColorAttachments[i].texture) if(mColorAttachments[i].texture)
frameBuffer->attachColorTexture(mColorAttachments[i].name, mColorAttachments[i].texture); frameBuffer->attachColorTexture(mColorAttachments[i].name, mColorAttachments[i].texture);
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
// All rights reserved. // // All rights reserved. //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#include <ACGL/OpenGL/Controller/VertexBufferControl.hh> #include <ACGL/OpenGL/Controller/VertexBufferObjectControl.hh>
using namespace ACGL::OpenGL; using namespace ACGL::OpenGL;
SharedVertexBuffer VertexBufferControl::create(void) SharedVertexBufferObject VertexBufferObjectControl::create(void)
{ {
GLenum mode = GL_TRIANGLES; GLenum mode = GL_TRIANGLES;
GLsizei elements = 0; GLsizei elements = 0;
...@@ -22,11 +22,11 @@ SharedVertexBuffer VertexBufferControl::create(void) ...@@ -22,11 +22,11 @@ SharedVertexBuffer VertexBufferControl::create(void)
elements = mArrayBuffers[0]->getElements(); elements = mArrayBuffers[0]->getElements();
} }
SharedVertexBuffer vertexBuffer(new VertexBuffer()); SharedVertexBufferObject vertexBuffer(new VertexBufferObject());
vertexBuffer->setElementArrayBuffer(mpElementArrayBuffer); vertexBuffer->setElementArrayBuffer(mpElementArrayBuffer);
for(VertexBuffer::ArrayBufferVec::size_type i = 0; i < mArrayBuffers.size(); i++) for(VertexBufferObject::ArrayBufferVec::size_type i = 0; i < mArrayBuffers.size(); i++)
{ {
vertexBuffer->attachArrayBuffer(mArrayBuffers[i]); vertexBuffer->attachArrayBuffer(mArrayBuffers[i]);
} }
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
// All rights reserved. // // All rights reserved. //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#include <ACGL/OpenGL/Controller/VertexBufferControlFileOBJ.hh> #include <ACGL/OpenGL/Controller/VertexBufferObjectControlFileOBJ.hh>
#include <ACGL/OpenGL/Controller/ArrayBufferControl.hh> #include <ACGL/OpenGL/Controller/ArrayBufferControl.hh>
#include <ACGL/OpenGL/Controller/ElementArrayBufferControl.hh> #include <ACGL/OpenGL/Controller/ElementArrayBufferControl.hh>
#include <ACGL/OpenGL/Controller/VertexBufferControl.hh> #include <ACGL/OpenGL/Controller/VertexBufferObjectControl.hh>
#include <ACGL/Base/StringOperations.hh> #include <ACGL/Base/StringOperations.hh>
#include <vector> #include <vector>
...@@ -18,11 +18,11 @@ using namespace ACGL::Base; ...@@ -18,11 +18,11 @@ using namespace ACGL::Base;
using namespace ACGL::Utils; using namespace ACGL::Utils;
using namespace ACGL::OpenGL; using namespace ACGL::OpenGL;
SharedVertexBuffer VertexBufferControlFileOBJ::create(void) SharedVertexBufferObject VertexBufferObjectControlFileOBJ::create(void)
{ {
updateFileModificationTime(); updateFileModificationTime();
SharedVertexBuffer vertexBuffer = VertexBufferControl(). SharedVertexBufferObject vertexBuffer = VertexBufferObjectControl().
index(ElementArrayBufferControl(). index(ElementArrayBufferControl().
mode(GL_TRIANGLES). mode(GL_TRIANGLES).
usage(GL_STATIC_DRAW). usage(GL_STATIC_DRAW).
...@@ -36,10 +36,10 @@ SharedVertexBuffer VertexBufferControlFileOBJ::create(void) ...@@ -36,10 +36,10 @@ SharedVertexBuffer VertexBufferControlFileOBJ::create(void)
if(loadOBJ(vertexBuffer)) if(loadOBJ(vertexBuffer))
return vertexBuffer; return vertexBuffer;
return SharedVertexBuffer(); return SharedVertexBufferObject();
} }
bool VertexBufferControlFileOBJ::update(SharedVertexBuffer& vertexBuffer) bool VertexBufferObjectControlFileOBJ::update(SharedVertexBufferObject& vertexBuffer)
{ {
if(fileIsUpToDate()) if(fileIsUpToDate())
return false; return false;
...@@ -51,7 +51,7 @@ bool VertexBufferControlFileOBJ::update(SharedVertexBuffer& vertexBuffer) ...@@ -51,7 +51,7 @@ bool VertexBufferControlFileOBJ::update(SharedVertexBuffer& vertexBuffer)
return true; return true;
} }
bool VertexBufferControlFileOBJ::loadOBJ(SharedVertexBuffer& _vertexBuffer) bool VertexBufferObjectControlFileOBJ::loadOBJ(SharedVertexBufferObject& _vertexBuffer)
{ {
std::string full = getFullFilePath(); std::string full = getFullFilePath();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment