Om
1.0.0
A universal framework for multimedia simulation
|
A class that encapsulates a set of vertex buffers associated with VertexUsage types. More...
#include <omGraphicsVertexBufferSet.h>
Public Member Functions | |
VertexBufferSet () | |
Create a new empty vertex buffer set. More... | |
Size | getBufferCount () const |
Return the number of vertex buffers in this vertex buffer set. More... | |
VertexBuffer * | getBuffer (Index bufferIndex) const |
Return a pointer to the buffer with the specified index in this vertex buffer set. More... | |
Bool | setBuffer (Index bufferIndex, VertexBuffer *buffer) |
Set the buffer at the specified index in this vertex buffer set. More... | |
VertexBuffer * | getBuffer (VertexUsage::Enum usage) const |
Return a pointer to the vertex buffer with the specified usage in this vertex buffer set. More... | |
VertexBuffer * | getBuffer (const VertexUsage &usage) const |
Return a pointer to the vertex buffer with the specified usage in this vertex buffer set. More... | |
Bool | setBuffer (VertexUsage::Enum usage, VertexBuffer *buffer) |
Set the buffer with the specified usage in this vertex buffer set. More... | |
Bool | setBuffer (const VertexUsage &usage, VertexBuffer *buffer) |
Set the buffer with the specified usage in this vertex buffer set. More... | |
const VertexUsage & | getBufferUsage (Index bufferIndex) const |
Return an object indicating the usage of the buffer with the specified index in this buffer list. More... | |
Bool | setBufferUsage (Index bufferIndex, const VertexUsage &newUsage) |
Set the usage of the buffer at the specified index in this vertex buffer set. More... | |
Bool | addBuffer (const VertexUsage &newUsage, VertexBuffer *newBuffer) |
Add a vertex buffer with the specified usage to this vertex buffer set. More... | |
Bool | removeBuffer (const VertexBuffer *buffer) |
Remove the first buffer with the specified address from this vertex buffer set. More... | |
Bool | removeBuffer (const VertexUsage &usage) |
Remove the first buffer with the specified usage from this vertex buffer set. More... | |
void | clearBuffers () |
Clear all vertex buffers from this vertex buffer set. More... | |
Size | getMinimumCapacity () const |
Return the smallest capacity of the buffers within this vertex buffer set. More... | |
void | setContext (devices::GraphicsContext *context) |
Prepare this vertex buffer set and its buffers for rendering with the specified context. More... | |
virtual void | upload (UploadRequest &request) |
Upload this vertex buffer set's CPU representation to the GPU device. More... | |
virtual void | download (DownloadRequest &request) |
Download the vertex buffer set's GPU representation to CPU memory. More... | |
Public Member Functions inherited from om::graphics::devices::GraphicsContextObject | |
virtual | ~GraphicsContextObject () |
Destory this graphics context object. More... | |
GraphicsContext * | getContext () const |
Return a pointer to the graphics context this context object is using to do rendering. More... | |
void | clearContext () |
Clear the previous context from this object. More... | |
void | upload () |
Upload this resource's CPU representation to the GPU device. More... | |
void | download () |
Upload this resource's CPU representation to the GPU device. More... | |
virtual Bool | isUploaded () const |
Return whether or not this graphics resource has been successfully created and uploaded to the device. More... | |
virtual Bool | isDownloaded () const |
Return whether or not this graphics resource has a copy of its data stored in CPU-side memory. More... | |
virtual Bool | isValid () const |
Return whether or not the state of this graphics resource is valid (either on CPU or GPU) and able to be used for rendering. More... | |
Static Public Attributes | |
static const ResourceType | RESOURCE_TYPE |
The resource type for a vertex buffer set. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from om::graphics::devices::GraphicsContextObject | |
GraphicsContextObject () | |
Create a new graphics context object that doesn't have an associated graphics context. More... | |
GraphicsContextObject (GraphicsContext *newContext) | |
Create a new graphics context object that uses the specified context for rendering. More... | |
Protected Attributes inherited from om::graphics::devices::GraphicsContextObject | |
GraphicsContext * | context |
A pointer to the graphics context this object is using. More... | |
A class that encapsulates a set of vertex buffers associated with VertexUsage types.
This class allows the user to provide external vertex data to a ShaderPass without having to modify the buffer bindings of the shader pass. This is useful when a shader pass is shared among many objects that may each have different vertex buffers.
At render time, an object's vertex buffer set is used to provide vertex data to the shader pass with which it is being rendered by connecting the VertexUsage of each buffer with shader inputs of the same usage types.
om::graphics::buffers::VertexBufferSet::VertexBufferSet | ( | ) |
Create a new empty vertex buffer set.
|
inline |
Return the number of vertex buffers in this vertex buffer set.
|
inline |
Return a pointer to the buffer with the specified index in this vertex buffer set.
|
inline |
Set the buffer at the specified index in this vertex buffer set.
|
inline |
Return a pointer to the vertex buffer with the specified usage in this vertex buffer set.
VertexBuffer* om::graphics::buffers::VertexBufferSet::getBuffer | ( | const VertexUsage & | usage | ) | const |
Return a pointer to the vertex buffer with the specified usage in this vertex buffer set.
|
inline |
Set the buffer with the specified usage in this vertex buffer set.
Bool om::graphics::buffers::VertexBufferSet::setBuffer | ( | const VertexUsage & | usage, |
VertexBuffer * | buffer | ||
) |
Set the buffer with the specified usage in this vertex buffer set.
|
inline |
Return an object indicating the usage of the buffer with the specified index in this buffer list.
|
inline |
Set the usage of the buffer at the specified index in this vertex buffer set.
Bool om::graphics::buffers::VertexBufferSet::addBuffer | ( | const VertexUsage & | newUsage, |
VertexBuffer * | newBuffer | ||
) |
Add a vertex buffer with the specified usage to this vertex buffer set.
Bool om::graphics::buffers::VertexBufferSet::removeBuffer | ( | const VertexBuffer * | buffer | ) |
Remove the first buffer with the specified address from this vertex buffer set.
The method returns whether or not the buffer was successfully removed.
Bool om::graphics::buffers::VertexBufferSet::removeBuffer | ( | const VertexUsage & | usage | ) |
Remove the first buffer with the specified usage from this vertex buffer set.
The method returns whether or not the buffer was successfully removed.
void om::graphics::buffers::VertexBufferSet::clearBuffers | ( | ) |
Clear all vertex buffers from this vertex buffer set.
Size om::graphics::buffers::VertexBufferSet::getMinimumCapacity | ( | ) | const |
Return the smallest capacity of the buffers within this vertex buffer set.
This value is computed by taking the minimum capacity of all buffers that the buffer list has which have data. If there are no buffers in the list, the method returns 0.
|
virtual |
Prepare this vertex buffer set and its buffers for rendering with the specified context.
The method propagates the context to the set's buffers and regenerates any context-specific data for the new context if the upload flag is TRUE. The method returns whether or not the context can be successfully used for rendering this vertex buffer set.
Reimplemented from om::graphics::devices::GraphicsContextObject.
|
virtual |
Upload this vertex buffer set's CPU representation to the GPU device.
Reimplemented from om::graphics::devices::GraphicsContextObject.
|
virtual |
Download the vertex buffer set's GPU representation to CPU memory.
Reimplemented from om::graphics::devices::GraphicsContextObject.
|
static |
The resource type for a vertex buffer set.