Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::IDynamicTextureAtlas Struct Referenceabstract

Dynamic texture atlas. More...

#include <DynamicTextureAtlas.h>

Inheritance diagram for Diligent::IDynamicTextureAtlas:
Diligent.IObject

Public Member Functions

virtual ITextureUpdate (IRenderDevice *pDevice, IDeviceContext *pContext)=0
 Updates the internal texture object.
 
virtual ITextureGetTexture () const =0
 Returns a pointer to the internal texture object.
 
virtual void Allocate (Uint32 Width, Uint32 Height, ITextureAtlasSuballocation **ppSuballocation)=0
 Performs suballocation from the atlas.
 
virtual const TextureDescGetAtlasDesc () const =0
 Returns the texture atlas description.
 
virtual Uint32 GetVersion () const =0
 
virtual void GetUsageStats (DynamicTextureAtlasUsageStats &Stats) const =0
 Returns the usage stats, see Diligent::DynamicTextureAtlasUsageStats.
 
virtual Uint32 GetAllocationAlignment (Uint32 Width, Uint32 Height) const =0
 Computes the allocation alignment for the region of a given size.
 
- Public Member Functions inherited from Diligent.IObject
virtual void DILIGENT_CALL_TYPE QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0
 Queries the specific interface.
 
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE AddRef ()=0
 Increments the number of strong references by 1.
 
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE Release ()=0
 
virtual IReferenceCounters *DILIGENT_CALL_TYPE GetReferenceCounters () const =0
 

Detailed Description

Dynamic texture atlas.

Member Function Documentation

◆ Allocate()

virtual void Diligent::IDynamicTextureAtlas::Allocate ( Uint32 Width,
Uint32 Height,
ITextureAtlasSuballocation ** ppSuballocation )
pure virtual

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()

virtual ITexture * Diligent::IDynamicTextureAtlas::Update ( IRenderDevice * pDevice,
IDeviceContext * pContext )
pure virtual

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.