uicore::TextureGroup Class Referenceabstract

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< Texture2DPtrtextures () const =0
 Returns the textures. More...
 

Static Public Member Functions

static std::shared_ptr< TextureGroupcreate (const Size &texture_size)
 Constructs a texture group. More...
 

Detailed Description

Dynamic atlas texture class.

Member Function Documentation

virtual TextureGroupImage uicore::TextureGroup::add ( const GraphicContextPtr context,
const Size size 
)
pure virtual

Allocate space for another sub texture.

virtual TextureGroupAllocationPolicy uicore::TextureGroup::allocation_policy ( ) const
pure virtual

Returns the texture allocation policy.

static std::shared_ptr<TextureGroup> uicore::TextureGroup::create ( const Size texture_size)
static

Constructs a texture group.

virtual void uicore::TextureGroup::insert_texture ( const Texture2DPtr texture,
const Rect texture_rect 
)
pure virtual

Insert an existing texture into the texture group.

Parameters
texture= Texture to insert
texture_rect= Free space within the texture that the texture group can use
virtual void uicore::TextureGroup::remove ( const TextureGroupImage subtexture)
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.

virtual void uicore::TextureGroup::set_allocation_policy ( TextureGroupAllocationPolicy  policy)
pure virtual

Set the texture allocation policy.

virtual int uicore::TextureGroup::subtexture_count ( ) const
pure virtual

Returns the amount of sub-textures allocated in group.

virtual int uicore::TextureGroup::subtexture_count ( unsigned int  texture_index) const
pure virtual

Returns the amount of sub-textures for a specific texture index.

virtual int uicore::TextureGroup::texture_count ( ) const
pure virtual

Returns the amount of textures used by group.

virtual Size uicore::TextureGroup::texture_size ( ) const
pure virtual

Returns the size of the textures used by this texture group.

virtual std::vector<Texture2DPtr> uicore::TextureGroup::textures ( ) const
pure virtual

Returns the textures.


The documentation for this class was generated from the following file: