12#ifndef MESH_H_6014714286
13#define MESH_H_6014714286
66 const std::unique_ptr< Association< VertexBufferBase > > myVertexBuffer;
67 const std::unique_ptr< Association< IndexBufferBase > > myIndexBuffer;
89 const unsigned int id;
134template<
typename VertexType,
typename IndexType >
152template<
typename VertexType,
typename IndexType >
Defines Carna::base::IndexBuffer.
Defines Carna::base::VertexAttributes.
Defines Carna::base::VertexBuffer.
Represents an association.
Wraps and represents an OpenGL context.
Maintains GL_ELEMENT_ARRAY_BUFFER object that holds the vertex indices, that interconnect the vertice...
Format-independent abstract Mesh base class. Each mesh consists of a VertexBuffer,...
virtual ~MeshBase()
Deletes.
const unsigned int id
Holds the ID of the OpenGL vertex array object.
VertexBufferBase & vertexBuffer()
References the mesh's vertex buffer.
MeshBase(const VertexAttributes &va, Association< VertexBufferBase > *vertexBuffer, Association< IndexBufferBase > *indexBuffer)
const VertexBufferBase & vertexBuffer() const
References the mesh's vertex buffer.
void render() const
Renders the mesh.
const GLContext & glContext
References the OpenGL context this mesh is valid within.
IndexBufferBase & indexBuffer()
References the mesh's index buffer.
void bind() const
Binds the vertex array object.
const IndexBufferBase & indexBuffer() const
References the mesh's index buffer.
Implements MeshBase class for particular VertexType and IndexType.
Mesh(Association< VertexBufferBase > *vertexBuffer, Association< IndexBufferBase > *indexBuffer)
IndexType Index
Holds the element type of the index buffer.
VertexType Vertex
Holds the element type of the vertex buffer.
Maintains GL_ARRAY_BUFFER object that holds vertices. This class realizes the RAII-idiom.
std::vector< VertexAttribute > VertexAttributes
Defines VertexAttribute vector.