Dynamic atlas texture class. More...
#include <texture_group.h>
Public Member Functions | |
virtual TextureGroupImage | add (const GraphicContextPtr &context, const Size &size)=0 |
Allocate space for another sub texture. More... | |
virtual TextureGroupAllocationPolicy | allocation_policy () const =0 |
Returns the texture allocation policy. More... | |
virtual void | insert_texture (const Texture2DPtr &texture, const Rect &texture_rect)=0 |
Insert an existing texture into the texture group. More... | |
virtual void | remove (const TextureGroupImage &subtexture)=0 |
Deallocate space, from a previously allocated texture. More... | |
virtual void | set_allocation_policy (TextureGroupAllocationPolicy policy)=0 |
Set the texture allocation policy. More... | |
virtual int | subtexture_count () const =0 |
Returns the amount of sub-textures allocated in group. More... | |
virtual int | subtexture_count (unsigned int texture_index) const =0 |
Returns the amount of sub-textures for a specific texture index. More... | |
virtual int | texture_count () const =0 |
Returns the amount of textures used by group. More... | |
virtual Size | texture_size () const =0 |
Returns the size of the textures used by this texture group. More... | |
virtual std::vector< Texture2DPtr > | textures () const =0 |
Returns the textures. More... | |
Static Public Member Functions | |
static std::shared_ptr< TextureGroup > | create (const Size &texture_size) |
Constructs a texture group. More... | |
Dynamic atlas texture class.
|
pure virtual |
Allocate space for another sub texture.
|
pure virtual |
Returns the texture allocation policy.
|
static |
Constructs a texture group.
|
pure virtual |
Insert an existing texture into the texture group.
texture | = Texture to insert |
texture_rect | = Free space within the texture that the texture group can use |
|
pure virtual |
Deallocate space, from a previously allocated texture.
Warning - It is advised to set TextureGroupAllocationPolicy to search_previous_textures if using this function. Also be aware of texture fragmentation. Empty textures are not removed.
|
pure virtual |
Set the texture allocation policy.
|
pure virtual |
Returns the amount of sub-textures allocated in group.
|
pure virtual |
Returns the amount of sub-textures for a specific texture index.
|
pure virtual |
Returns the amount of textures used by group.
|
pure virtual |
Returns the size of the textures used by this texture group.
|
pure virtual |
Returns the textures.