class
Texture
Abstract class representing a texture.
Specific render systems have their own Texture implementations. Internally represented as one or more surfaces with pixels in a certain number of dimensions, backed by a hardware buffer.
Public
Constructors
Texture
*********************************************************************
Methods
WriteData
Updates the texture with new data.
Provided data buffer will be locked until the operation completes.
- data
- Pixel data to write. User must ensure it is in format and size compatible with the texture.
- face
- Texture face to write to.
- mipLevel
- Mipmap level to write to.
- discardEntireBuffer
- When true the existing contents of the resource you are updating will be discarded. This can make the operation faster. Resources with certain buffer types might require this flag to be in a specific state otherwise the operation will fail.
Returns: Async operation object you can use to track operation completion.
ReadData
Reads internal texture data to the provided previously allocated buffer.
Provided data buffer will be locked until the operation completes.
- data
- Pre-allocated buffer of proper size and format where data will be read to. You can use TextureProperties::allocBuffer() to allocate a buffer of a correct format and size.
- face
- Texture face to read from.
- mipLevel
- Mipmap level to read from.
Returns: Async operation object you can use to track operation completion.
ReadData
Reads internal texture data into a newly allocated buffer.
- face
- Texture face to read from.
- mipLevel
- Mipmap level to read from.
Returns: Async operation object that will contain the buffer with the data once the operation completes.
ReadCachedData
Reads data from the cached system memory texture buffer into the provided buffer.
- data
- Pre-allocated buffer of proper size and format where data will be read to. You can use TextureProperties::allocBuffer() to allocate a buffer of a correct format and size.
- face
- Texture face to read from.
- mipLevel
- Mipmap level to read from.
GetProperties
Returns properties that contain information about the texture.
staticCreate
Creates a new texture.
- createInformation
- Description of the texture to create.
staticGetRttiStatic
Internal
Methods
staticCreateEmpty
Creates an empty texture with default parameters.
Requires an explicit call to Initialize() before use. Primarily intended for deserialization.
Protected
Constructors
Texture
Texture
Methods
Initialize
Initializes all the internal data of this object.
Must be called right after construction for new objects, or after deserialization for deserialized objects. If requested, render proxy is created and queued for initialization on the render thread.
CreateRenderProxy
Creates an object that contains render thread specific data and methods for this object.
Can be null if such object is not required.
CalculateSize
Calculates the size of the texture, in bytes.
CreateCpuBuffers
Creates buffers used for caching of CPU texture data.
UpdateCpuBuffers
Updates the cached CPU buffers with new data.