Ocular Engine
|
Combination of a VertexBuffer and IndexBuffer. More...
#include <SubMesh.hpp>
Public Member Functions | |
bool | bind () |
void | unbind () |
void | unload () |
void | setVertexBuffer (VertexBuffer *buffer) |
VertexBuffer * | getVertexBuffer () |
void | setIndexBuffer (IndexBuffer *buffer) |
IndexBuffer * | getIndexBuffer () |
Protected Attributes | |
VertexBuffer * | m_VertexBuffer |
IndexBuffer * | m_IndexBuffer |
Combination of a VertexBuffer and IndexBuffer.
IndexBuffer * Ocular::Graphics::SubMesh::getIndexBuffer | ( | ) |
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.
void Ocular::Graphics::SubMesh::setIndexBuffer | ( | IndexBuffer * | buffer | ) |
Sets the IndexBuffer for this Mesh.
[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.
[in] | buffer |
void Ocular::Graphics::SubMesh::unload | ( | ) |
Unloads this Mesh from CPU and GPU memory