Carna
Version 3.3.2
|
Format-independent abstract Mesh base class. Each mesh consists of a VertexBuffer, an IndexBuffer and a vertex array. This class realizes the RAII-idiom w.r.t. the vertex array. More...
#include <Mesh.h>
Public Member Functions | |
MeshBase (const VertexAttributes &va, Association< VertexBufferBase > *vertexBuffer, Association< IndexBufferBase > *indexBuffer) | |
virtual | ~MeshBase () |
Deletes. More... | |
void | bind () const |
Binds the vertex array object. More... | |
void | render () const |
Renders the mesh. More... | |
const VertexBufferBase & | vertexBuffer () const |
References the mesh's vertex buffer. | |
const IndexBufferBase & | indexBuffer () const |
References the mesh's index buffer. | |
VertexBufferBase & | vertexBuffer () |
References the mesh's vertex buffer. | |
IndexBufferBase & | indexBuffer () |
References the mesh's index buffer. | |
Public Attributes | |
const unsigned int | id |
Holds the ID of the OpenGL vertex array object. | |
const GLContext & | glContext |
References the OpenGL context this mesh is valid within. | |
Format-independent abstract Mesh base class. Each mesh consists of a VertexBuffer, an IndexBuffer and a vertex array. This class realizes the RAII-idiom w.r.t. the vertex array.
The class maintains a so-called OpenGL vertex array in RAII-manner, which, contrary to its name, basically is a conjunction of vertex and index buffer. Because a vertex array is not sharable across OpenGL contexts, objects from this class are always coupled to a particular context.
Any OpenGL object types which are not containers are sharable, as well as Sync Objects and GLSL Objects (excluding program pipeline objects). All container objects are not shared between contexts. [1]
Container objects:
- Framebuffer Objects
- Program Pipeline
- Transform Feedback Objects
- Vertex Array Objects [2]
References:
Carna::base::MeshBase::MeshBase | ( | const VertexAttributes & | va, |
Association< VertexBufferBase > * | vertexBuffer, | ||
Association< IndexBufferBase > * | indexBuffer | ||
) |
Creates new mesh. It is only valid within the current OpenGL context.
&GLContext::current() == &glContext
|
virtual |
Deletes.
&GLContext::current() == &glContext
void Carna::base::MeshBase::bind | ( | ) | const |
Binds the vertex array object.
&GLContext::current() == &glContext
void Carna::base::MeshBase::render | ( | ) | const |
Renders the mesh.
&GLContext::current() == &glContext
Documentation generated by Doxygen