Cogs.Rendering
|
Provides texture management functionality. More...
#include <ITextures.h>
Public Member Functions | |
virtual void | annotate (TextureHandle handle, const StringView &name) |
Associate a name with an object for use in graphics debugging. | |
virtual TextureHandle | loadTexture (const unsigned char *bytes, unsigned int width, unsigned int height, TextureFormat format, unsigned int flags=0)=0 |
Load a texture using the given data to populate the texture contents. | |
virtual TextureHandle | loadTexture (const unsigned char *bytes, unsigned int width, unsigned int height, TextureFormat format, unsigned int numSamples, unsigned int flags)=0 |
Load a texture using the given data to populate the texture contents. | |
virtual TextureHandle | loadTextureMipMaps (const unsigned char **bytes, size_t numLevels, const unsigned int *widths, const unsigned int *heights, TextureFormat format, unsigned int flags=0)=0 |
Load a texture with multiple mipmap levels using the given data to populate the texture contents. | |
virtual TextureHandle | loadTextureArray (const unsigned char **bytes, const size_t arraySize, const size_t numLevels, const unsigned int *widths, const unsigned int *heights, TextureFormat format, unsigned int flags=0)=0 |
Load an array texture with mipmaps using the given data to populate the texture contents. | |
virtual TextureHandle | loadCubeMap (const unsigned char **bytes, const size_t arraySize, const size_t numLevels, const unsigned int *widths, const unsigned int *heights, TextureFormat format, unsigned int flags=0)=0 |
Load a cube map texture with mipmaps using the given data to populate the texture contents. | |
virtual TextureHandle | loadTexture (const TextureDescription &desc, const TextureData *data)=0 |
Load a texture from the given description. | |
virtual void | uploadTextureData (TextureHandle textureHandle, const TextureData &data, uint32_t layer_offset=0, uint32_t face_offset=0, uint32_t level_offset=0) |
Upload a texture from the given description. | |
virtual void | releaseTexture (TextureHandle textureHandle)=0 |
Release the texture with the given textureHandle. | |
virtual void | releaseNativeTexture (TextureNativeHandle nativeHandle) |
Release a native texture handle. | |
virtual TextureViewHandle | createTextureView (TextureViewDescription &viewDescription)=0 |
Create a texture view used to bind a limited view of the texture data to the rendering pipeline. | |
virtual void | releaseTextureView (const TextureViewHandle &handle)=0 |
Release the given texture view. | |
virtual SamplerStateHandle | loadSamplerState (const SamplerState &state)=0 |
Load a sampler state object. | |
virtual void | releaseSamplerState (SamplerStateHandle handle)=0 |
Release the sampler state with the given handle. | |
virtual void | generateMipmaps (TextureHandle textureHandle)=0 |
Use the graphics device to generate mipmaps for the texture with the given texture handle. | |
virtual void * | getNativeHandle (TextureHandle textureHandle)=0 |
Get the device-specific handle (D3D texture pointer, OpenGL texture ID etc) associated with the given texture handle. | |
virtual void | releaseResources ()=0 |
Release all allocated texture resources. | |
Provides texture management functionality.
|
inlinevirtual |
Associate a name with an object for use in graphics debugging.
|
pure virtual |
Create a texture view used to bind a limited view of the texture data to the rendering pipeline.
viewDescription | Description of the texture view. |
|
pure virtual |
Use the graphics device to generate mipmaps for the texture with the given texture handle.
textureHandle | Valid handle to a previously created texture object. The texture must have been created with the TextureFlags::GenerateMipMaps flag. |
|
pure virtual |
Get the device-specific handle (D3D texture pointer, OpenGL texture ID etc) associated with the given texture handle.
textureHandle | Valid handle to a previously created texture object. |
|
pure virtual |
Load a cube map texture with mipmaps using the given data to populate the texture contents.
bytes | Pointer to an array of pointers to texture data. If nullptr is given an empty cube texture with the given number of mipmaps, dimensions and format is created. The number of pointers to texture data must be at least 6 * numLevels. |
arraySize | Must be 1. |
numLevels | Number of mipmap levels. |
widths | Pointer to an array of widths given in pixels. Size of the array must be at least 6 * numLevels. |
heights | Pointer to an array of heights given in pixels. Size of the array must be at least 6 * numLevels. |
format | Format of the texture data. Must be same for all mipmap levels and array levels. |
flags | Texture flags used to determine which operations are supported by the created texture array. |
|
pure virtual |
Load a sampler state object.
state | Sampler state structure used to initialize the sampler state object on the graphics device. |
|
pure virtual |
Load a texture from the given description.
desc | Texture description. |
data | Optional texture content. |
|
pure virtual |
Load a texture using the given data to populate the texture contents.
bytes | Pointer to texture data. If nullptr is given an empty texture with the given dimensions and format is created. |
width | Width of the texture in pixels. |
height | Height of the texture in pixels. |
format | Format of the texture data. |
flags | Texture flags used to determine which operations are supported by the created texture. |
|
pure virtual |
Load a texture using the given data to populate the texture contents.
bytes | Pointer to texture data. If nullptr is given an empty texture with the given dimensions and format is created. |
width | Width of the texture in pixels. |
height | Height of the texture in pixels. |
format | Format of the texture data. |
numSamples | Number of samples to use per pixel in the texture. |
flags | Texture flags used to determine which operations are supported by the created texture. |
|
pure virtual |
Load an array texture with mipmaps using the given data to populate the texture contents.
bytes | Pointer to an array of pointers to texture data. If nullptr is given an empty texture with the given number of array levels, mipmaps, dimensions and format is created. The number of pointers to texture data must be at least arraySize * numLevels. |
arraySize | Size of the texture array to create. |
numLevels | Number of mipmap levels. |
widths | Pointer to an array of widths given in pixels. Size of the array must be at least arraySize * numLevels. |
heights | Pointer to an array of heights given in pixels. Size of the array must be at least arraySize * numLevels. |
format | Format of the texture data. Must be same for all mipmap levels and array levels. |
flags | Texture flags used to determine which operations are supported by the created texture array. |
|
pure virtual |
Load a texture with multiple mipmap levels using the given data to populate the texture contents.
bytes | Pointer to an array of pointers to texture data. If nullptr is given an empty texture with the given number of mipmaps, dimensions and format is created. |
numLevels | Number of mipmap levels. |
widths | Pointer to an array of widths, one for each mipmap, given in pixels. |
heights | Pointer to an array of heights, one for each mipmap, given in pixels. |
format | Format of the texture data. Must be same for all mipmap levels. |
flags | Texture flags used to determine which operations are supported by the created texture. |
|
inlinevirtual |
Release a native texture handle.
nativeHandle | is a handle to a natively created texture (Created directly from the graphics API). |
|
pure virtual |
Release all allocated texture resources.
|
pure virtual |
Release the sampler state with the given handle.
handle | Valid handle to a previously created sampler state. |
|
pure virtual |
Release the texture with the given textureHandle.
textureHandle | Valid handle to a previously created texture object. |
|
pure virtual |
Release the given texture view.
handle | Valid handle to a previously created texture view. |
|
inlinevirtual |
Upload a texture from the given description.
desc | Texture description. |
data | Optional texture content. |