Commit 6c294ed8 authored by Robert Menzel's avatar Robert Menzel

Moved objects

OpenGL/Objects now only contains wrappers of OpenGL objects, all higher-level objects are moved to OpenGL/HiLevelObjects. Also moved LocationMappings to OpenGL/Data.
OpenGL/Objects.hh still includes the high-level stuff. In the hi-level collection multiple alternative concepts can be collected to achieve similar functionality (Uniform objects instead of UniformBuffers for example) which is fine but should not lead to confusion that just the OpenGL objects in Objects/ are the main building blocks on which the HiLevelObjects/ rely on.
parent 51812532
......@@ -11,7 +11,7 @@
#if (ACGL_OPENGL_VERSION >= 30)
#include <ACGL/Resource/BasicCreateController.hh>
#include <ACGL/OpenGL/Objects/RenderObject.hh>
#include <ACGL/OpenGL/HiLevelObjects/RenderObject.hh>
namespace ACGL{
namespace OpenGL{
......
......@@ -9,7 +9,7 @@
#include <ACGL/ACGL.hh>
#include <ACGL/Resource/FileController.hh>
#include <ACGL/OpenGL/Objects/ShaderProgramObject.hh>
#include <ACGL/OpenGL/HiLevelObjects/ShaderProgramObject.hh>
#include <ACGL/OpenGL/GL.hh>
#include <vector>
......
......@@ -9,7 +9,7 @@
#include <ACGL/ACGL.hh>
#include <ACGL/Resource/BasicCreateController.hh>
#include <ACGL/OpenGL/Objects/Uniform.hh>
#include <ACGL/OpenGL/HiLevelObjects/Uniform.hh>
#include <ACGL/OpenGL/GL.hh>
namespace ACGL{
......
......@@ -9,7 +9,7 @@
#include <ACGL/ACGL.hh>
#include <ACGL/Resource/BasicCreateController.hh>
#include <ACGL/OpenGL/Objects/VertexBufferObject.hh>
#include <ACGL/OpenGL/HiLevelObjects/VertexBufferObject.hh>
#include <ACGL/OpenGL/Objects/ShaderProgram.hh>
#include <ACGL/OpenGL/GL.hh>
......
......@@ -10,7 +10,7 @@
#include <ACGL/Resource/FileController.hh>
#include <ACGL/Base/Settings.hh>
#include <ACGL/OpenGL/Objects/VertexBufferObject.hh>
#include <ACGL/OpenGL/HiLevelObjects/VertexBufferObject.hh>
#include <ACGL/OpenGL/Objects/ShaderProgram.hh>
#include <ACGL/OpenGL/GL.hh>
......
......@@ -27,9 +27,9 @@
#if (ACGL_OPENGL_VERSION >= 30)
#include <ACGL/OpenGL/Objects/VertexArrayObject.hh>
#include <ACGL/OpenGL/Objects/ShaderProgramObject.hh>
#include <ACGL/OpenGL/HiLevelObjects/ShaderProgramObject.hh>
#include <ACGL/OpenGL/Objects/FrameBufferObject.hh>
#include <ACGL/OpenGL/Objects/Viewport.hh>
#include <ACGL/OpenGL/HiLevelObjects/Viewport.hh>
namespace ACGL {
......
......@@ -25,7 +25,7 @@
#include <ACGL/Base/Macros.hh>
#include <ACGL/OpenGL/GL.hh>
#include <ACGL/OpenGL/Objects/ShaderProgram.hh>
#include <ACGL/OpenGL/Objects/Uniform.hh>
#include <ACGL/OpenGL/HiLevelObjects/Uniform.hh>
namespace ACGL{
......
......@@ -7,27 +7,30 @@
#define ACGL_OPENGL_OBJECTS_HH
/*
* A shortcut to include all OpenGL objects.
* A shortcut to include all OpenGL objects as well as high-level objects.
*/
#include <ACGL/ACGL.hh>
// low-level objects (with direct OpenGL counterparts):
#include <ACGL/OpenGL/Objects/Buffer.hh>
#include <ACGL/OpenGL/Objects/ArrayBuffer.hh>
#include <ACGL/OpenGL/Objects/ElementArrayBuffer.hh>
#include <ACGL/OpenGL/Objects/UniformBuffer.hh>
#include <ACGL/OpenGL/Objects/FrameBufferObject.hh>
#include <ACGL/OpenGL/Objects/RenderBuffer.hh>
#include <ACGL/OpenGL/Objects/UniformBuffer.hh>
#include <ACGL/OpenGL/Objects/RenderObject.hh>
#include <ACGL/OpenGL/Objects/Shader.hh>
#include <ACGL/OpenGL/Objects/ShaderProgram.hh>
#include <ACGL/OpenGL/Objects/ProgramPipeline.hh>
#include <ACGL/OpenGL/Objects/ShaderProgramObject.hh>
#include <ACGL/OpenGL/Objects/Texture.hh>
#include <ACGL/OpenGL/Objects/Sampler.hh>
#include <ACGL/OpenGL/Objects/Uniform.hh>
#include <ACGL/OpenGL/Objects/VertexBufferObject.hh>
#include <ACGL/OpenGL/Objects/Viewport.hh>
#include <ACGL/OpenGL/Objects/Query.hh>
#include <ACGL/OpenGL/Objects/Shader.hh>
#include <ACGL/OpenGL/Objects/ShaderProgram.hh>
// high-level objects (combineing multiple OpenGL objects, wrapping non-object related OpenGL funtions etc):
#include <ACGL/OpenGL/HiLevelObjects/Uniform.hh>
#include <ACGL/OpenGL/HiLevelObjects/VertexBufferObject.hh>
#include <ACGL/OpenGL/HiLevelObjects/Viewport.hh>
#include <ACGL/OpenGL/HiLevelObjects/ShaderProgramObject.hh>
#include <ACGL/OpenGL/HiLevelObjects/RenderObject.hh>
#endif // ACGL_OPENGL_OBJECTS_HH
......@@ -30,7 +30,7 @@
#include <ACGL/OpenGL/Tools.hh>
#include <ACGL/OpenGL/Objects/RenderBuffer.hh>
#include <ACGL/OpenGL/Objects/Texture.hh>
#include <ACGL/OpenGL/Objects/LocationMappings.hh>
#include <ACGL/OpenGL/Data/LocationMappings.hh>
#include <vector>
#include <map>
......
......@@ -46,7 +46,7 @@
#include <ACGL/OpenGL/GL.hh>
#include <ACGL/OpenGL/Objects/Shader.hh>
#include <ACGL/OpenGL/Objects/Texture.hh>
#include <ACGL/OpenGL/Objects/LocationMappings.hh>
#include <ACGL/OpenGL/Data/LocationMappings.hh>
#include <ACGL/Math/Math.hh>
#include <vector>
......
......@@ -35,7 +35,7 @@
#include <ACGL/OpenGL/Tools.hh>
#include <ACGL/OpenGL/Objects/Buffer.hh>
#include <ACGL/OpenGL/Objects/LocationMappings.hh>
#include <ACGL/OpenGL/Data/LocationMappings.hh>
#include <ACGL/Math/Math.hh>
#if (ACGL_OPENGL_VERSION >= 31)
......
......@@ -54,7 +54,6 @@ public:
{
SharedArrayBuffer arrayBuffer; // the ArrayBuffer to use
int32_t attributeID; // the attribute from that ArrayBuffer
//GLint location; // a location the in-attribute from a shader is bound to
// more Attribute properties can be looked up in the ArrayBuffer (like the name)
};
......@@ -68,22 +67,7 @@ public:
// ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/
public:
VertexArrayObject()
: mpElementArrayBuffer(),
mAttributes(),
mObjectName(0),
mMode(GL_TRIANGLES)
{
glGenVertexArrays(1, &mObjectName);
GLint maxAttributes;
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxAttributes);
if (openGLCriticalErrorOccured() ) {
ACGL::Utils::error() << "could not generate vertex array object!" << std::endl;
}
mAttributes.resize( maxAttributes ); // reserve probably 16 slots, the size() can now be used to query the MAX_VERTEX_ATTRIBS
}
VertexArrayObject();
virtual ~VertexArrayObject(void)
{
......@@ -120,6 +104,7 @@ public:
inline GLuint getObjectName(void) const { return mObjectName; }
inline const AttributeVec& getAttributes(void) const { return mAttributes; }
inline GLenum getMode (void) const { return mMode; }
inline SharedElementArrayBuffer getElementArrayBuffer (void) const { return mpElementArrayBuffer; }
// ==================================================================================================== \/
// ============================================================================================ METHODS \/
......
......@@ -3,7 +3,7 @@
// All rights reserved. //
////////////////////////////////////////////////////////////////////////////////
#include <ACGL/OpenGL/Objects/LocationMappings.hh>
#include <ACGL/OpenGL/Data/LocationMappings.hh>
using namespace ACGL;
using namespace ACGL::OpenGL;
......
......@@ -3,7 +3,7 @@
// All rights reserved. //
////////////////////////////////////////////////////////////////////////////////
#include <ACGL/OpenGL/Objects/RenderObject.hh>
#include <ACGL/OpenGL/HiLevelObjects/RenderObject.hh>
#if (ACGL_OPENGL_VERSION >= 30)
#include <ACGL/OpenGL/Tools.hh>
......
......@@ -3,7 +3,7 @@
// All rights reserved. //
////////////////////////////////////////////////////////////////////////////////
#include <ACGL/OpenGL/Objects/ShaderProgramObject.hh>
#include <ACGL/OpenGL/HiLevelObjects/ShaderProgramObject.hh>
using namespace ACGL::OpenGL;
......
......@@ -8,7 +8,7 @@
// this code is deprecated and will shortly be removed completely
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#include <ACGL/OpenGL/Objects/VertexBufferObject.hh>
#include <ACGL/OpenGL/HiLevelObjects/VertexBufferObject.hh>
using namespace ACGL;
using namespace ACGL::OpenGL;
......
......@@ -10,6 +10,23 @@ using namespace ACGL;
using namespace ACGL::Utils;
using namespace ACGL::OpenGL;
VertexArrayObject::VertexArrayObject() :
mpElementArrayBuffer(),
mAttributes(),
mObjectName(0),
mMode(GL_TRIANGLES)
{
glGenVertexArrays(1, &mObjectName);
GLint maxAttributes;
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxAttributes);
if (openGLCriticalErrorOccured() ) {
ACGL::Utils::error() << "could not generate vertex array object!" << std::endl;
}
mAttributes.resize( maxAttributes ); // reserve probably 16 slots, the size() can now be used to query the MAX_VERTEX_ATTRIBS
}
void VertexArrayObject::attachElementArrayBuffer( const SharedElementArrayBuffer& _elementArrayBuffer )
{
storeOldVAOandBind();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment