Om
1.0.0
A universal framework for multimedia simulation
|
A class that encapsulates a set of textures associated with TextureUsage types. More...
#include <omGraphicsTextureSet.h>
Public Member Functions | |
TextureSet () | |
Create a new empty texture set. More... | |
Size | getTextureCount () const |
Return the number of textures in this texture set. More... | |
Texture * | getTexture (Index textureIndex) const |
Return the texture at the specified index in this texture set. More... | |
Bool | setTexture (Index textureIndex, Texture *texture) |
Set the texture at the specified index in this texture set. More... | |
Texture * | getTexture (TextureUsage::Enum usage) const |
Return a pointer to the texture with the specified usage in this texture set. More... | |
Texture * | getTexture (const TextureUsage &usage) const |
Return a pointer to the texture with the specified usage in this texture set. More... | |
Bool | setTexture (TextureUsage::Enum usage, Texture *texture) |
Set the texture with the specified usage in this texture set. More... | |
Bool | setTexture (const TextureUsage &usage, Texture *texture) |
Set the texture with the specified usage in this texture set. More... | |
const TextureUsage & | getTextureUsage (Index textureIndex) const |
Return the usage type of the texture at the specified index in this texture set. More... | |
Bool | setTextureUsage (Index textureIndex, const TextureUsage &newUsage) |
Set the usage of the texture at the specified index in this texture set. More... | |
Bool | addTexture (const TextureUsage &usage, Texture *texture) |
Add a texture with the specified usage to this texture set. More... | |
Bool | removeTexture (const Texture *texture) |
Remove the first texture with the specified address from this texture set. More... | |
Bool | removeTexture (const TextureUsage &usage) |
Remove the texture with the specified usage from this texture set. More... | |
void | clearTextures () |
Clear all textures from this texture set. More... | |
void | setContext (devices::GraphicsContext *context) |
Prepare this texture set and its textures for rendering with the specified context. More... | |
virtual void | upload (UploadRequest &request) |
Upload this texture set's CPU representation to the GPU device. More... | |
virtual void | download (DownloadRequest &request) |
Download the texture 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 graphics texture 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 textures associated with TextureUsage types.
This class allows the user to provide external texture data to a ShaderPass without having to modify the texture bindings of the shader pass. This is useful when a shader pass is shared among many objects that may each have different textures.
At render time, an object's texture set is used to provide texture data to the shader pass with which it is being rendered by connecting the TextureUsage of each texture with shader inputs of the same usage types.
om::graphics::textures::TextureSet::TextureSet | ( | ) |
Create a new empty texture set.
|
inline |
Return the number of textures in this texture set.
Return the texture at the specified index in this texture set.
|
inline |
Set the texture at the specified index in this texture set.
|
inline |
Return a pointer to the texture with the specified usage in this texture set.
Texture* om::graphics::textures::TextureSet::getTexture | ( | const TextureUsage & | usage | ) | const |
Return a pointer to the texture with the specified usage in this texture set.
|
inline |
Set the texture with the specified usage in this texture set.
Bool om::graphics::textures::TextureSet::setTexture | ( | const TextureUsage & | usage, |
Texture * | texture | ||
) |
Set the texture with the specified usage in this texture set.
|
inline |
Return the usage type of the texture at the specified index in this texture set.
|
inline |
Set the usage of the texture at the specified index in this texture set.
Bool om::graphics::textures::TextureSet::addTexture | ( | const TextureUsage & | usage, |
Texture * | texture | ||
) |
Add a texture with the specified usage to this texture set.
Remove the first texture with the specified address from this texture set.
The method returns whether or not the texture was successfully removed.
Bool om::graphics::textures::TextureSet::removeTexture | ( | const TextureUsage & | usage | ) |
Remove the texture with the specified usage from this texture set.
The method returns whether or not the texture was successfully removed.
void om::graphics::textures::TextureSet::clearTextures | ( | ) |
Clear all textures from this texture set.
|
virtual |
Prepare this texture set and its textures for rendering with the specified context.
The method propagates the context to the set's textures 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 texture set.
Reimplemented from om::graphics::devices::GraphicsContextObject.
|
virtual |
Upload this texture set's CPU representation to the GPU device.
Reimplemented from om::graphics::devices::GraphicsContextObject.
|
virtual |
Download the texture set's GPU representation to CPU memory.
Reimplemented from om::graphics::devices::GraphicsContextObject.
|
static |
The resource type for a graphics texture set.