Ocular Engine
Ocular::Graphics::SubMesh Class Reference

Combination of a VertexBuffer and IndexBuffer. More...

#include <SubMesh.hpp>

Public Member Functions

bool bind ()
 
void unbind ()
 
void unload ()
 
void setVertexBuffer (VertexBuffer *buffer)
 
VertexBuffergetVertexBuffer ()
 
void setIndexBuffer (IndexBuffer *buffer)
 
IndexBuffergetIndexBuffer ()
 

Protected Attributes

VertexBufferm_VertexBuffer
 
IndexBufferm_IndexBuffer
 

Detailed Description

Combination of a VertexBuffer and IndexBuffer.

Member Function Documentation

bool Ocular::Graphics::SubMesh::bind ( )

Binds the Vertex and Index Buffers of this SubMesh

IndexBuffer * Ocular::Graphics::SubMesh::getIndexBuffer ( )
Note
Any changes made to the buffer will not take affect until IndexBuffer::build is called and the Mesh is rebound.
Returns
A pointer to the current IndexBuffer for this mesh.
VertexBuffer * Ocular::Graphics::SubMesh::getVertexBuffer ( )

Returns a pointer to the current vertex buffer of this mesh, which can then be modified.

After modifying vertex data, one should call either calculateMinMaxPoints() or setMinMaxPoints() so that bounding volumes, etc. based off of this mesh will be accurate.

Any changes made to the buffer will not take affect until VertexBuffer::build is called and the Mesh is rebound.

Returns
A pointer to the current VertexBuffer for this mesh.
void Ocular::Graphics::SubMesh::setIndexBuffer ( IndexBuffer buffer)

Sets the IndexBuffer for this Mesh.

Note
The Mesh takes ownership of the buffer and will delete it when it is no longer in use.
Parameters
[in]buffer
void Ocular::Graphics::SubMesh::setVertexBuffer ( VertexBuffer buffer)

Sets the VertexBuffer for this Mesh.

After modifying vertex data, one should call either calculateMinMaxPoints() or setMinMaxPoints() so that bounding volumes, etc. based off of this mesh will be accurate.

The Mesh takes ownership of the buffer and will delete it when it is no longer in use.

Parameters
[in]buffer
void Ocular::Graphics::SubMesh::unbind ( )

Unbinds the Vertex and Index Buffers of this SubMesh

void Ocular::Graphics::SubMesh::unload ( )

Unloads this Mesh from CPU and GPU memory


The documentation for this class was generated from the following files: