Dynamic texture atlas.
More...
#include <DynamicTextureAtlas.h>
◆ Allocate()
Performs suballocation from the atlas.
- Parameters
-
[in] | Width | - Suballocation width. |
[in] | Height | - Suballocation height. |
[out] | ppSuballocation | - Memory location where pointer to the new suballocation will be stored. |
The method is thread-safe and can be called from multiple threads simultaneously.
Internal texture array may need to be extended after the allocation happened. An application may call the Update() to ensure that the texture is resized and old contents is copied.
◆ GetAllocationAlignment()
virtual Uint32 Diligent::IDynamicTextureAtlas::GetAllocationAlignment |
( |
Uint32 | Width, |
|
|
Uint32 | Height ) const |
|
pure virtual |
Computes the allocation alignment for the region of a given size.
- Parameters
-
[in] | Width | - Region width. |
[in] | Height | - Region height. |
- Returns
- - Allocation alignment.
◆ GetTexture()
virtual ITexture * Diligent::IDynamicTextureAtlas::GetTexture |
( |
| ) |
const |
|
pure virtual |
Returns a pointer to the internal texture object.
If the texture has not been created yet, the method returns null. If the texture may need to be updated (initialized or resized), use the Update() method.
◆ GetVersion()
virtual Uint32 Diligent::IDynamicTextureAtlas::GetVersion |
( |
| ) |
const |
|
pure virtual |
Returns internal texture array version. The version is incremented every time the array is expanded.
◆ Update()
Updates the internal texture object.
- Parameters
-
[in] | pDevice | - A pointer to the render device that will be used to create a new internal texture array, if necessary. |
[in] | pContext | - A pointer to the device context that will be used to copy existing contents to the new texture array, if necessary. |
If the internal texture needs to be resized, pDevice
and pContext
will be used to create a new texture and copy existing contents to it.
The method is not thread safe. An application must externally synchronize the access.