Texture grouping class.
More...
#include <texture_group.h>
◆ TextureAllocationPolicy
Texture allocation policy.
Enumerator |
---|
create_new_texture | |
search_previous_textures | |
◆ TextureGroup() [1/2]
clan::TextureGroup::TextureGroup |
( |
| ) |
|
Constructs a null instance.
◆ TextureGroup() [2/2]
clan::TextureGroup::TextureGroup |
( |
const Size & |
texture_sizes | ) |
|
Constructs a texture group.
◆ ~TextureGroup()
clan::TextureGroup::~TextureGroup |
( |
| ) |
|
◆ add()
Allocate space for another sub texture.
◆ get_subtexture_count() [1/2]
int clan::TextureGroup::get_subtexture_count |
( |
| ) |
const |
Returns the amount of sub-textures allocated in group.
◆ get_subtexture_count() [2/2]
int clan::TextureGroup::get_subtexture_count |
( |
unsigned int |
texture_index | ) |
const |
Returns the amount of sub-textures for a specific texture index.
◆ get_texture_allocation_policy()
Returns the texture allocation policy.
◆ get_texture_count()
int clan::TextureGroup::get_texture_count |
( |
| ) |
const |
Returns the amount of textures used by group.
◆ get_texture_sizes()
Size clan::TextureGroup::get_texture_sizes |
( |
| ) |
const |
Returns the size of the textures used by this texture group.
◆ get_textures()
std::vector<Texture2D> clan::TextureGroup::get_textures |
( |
| ) |
const |
◆ insert_texture()
void clan::TextureGroup::insert_texture |
( |
Texture2D & |
texture, |
|
|
const Rect & |
texture_rect |
|
) |
| |
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 |
◆ is_null()
bool clan::TextureGroup::is_null |
( |
| ) |
const |
|
inline |
Returns true if this object is invalid.
◆ operator bool()
clan::TextureGroup::operator bool |
( |
| ) |
const |
|
inlineexplicit |
◆ remove()
void clan::TextureGroup::remove |
( |
Subtexture & |
subtexture | ) |
|
Deallocate space, from a previously allocated texture.
Warning - It is advised to set TextureAllocationPolicy to search_previous_textures if using this function. Also be aware of texture fragmentation. Empty textures are not removed.
◆ set_texture_allocation_policy()
Set the texture allocation policy.
◆ throw_if_null()
void clan::TextureGroup::throw_if_null |
( |
| ) |
const |
Throw an exception if this object is invalid.
The documentation for this class was generated from the following file: