CL_TextureGroup Class Reference
[clanDisplay 2D]

Texture grouping class. More...

#include <texture_group.h>

List of all members.

Public Types

Enumerations
enum  TextureAllocationPolicy { create_new_texture, search_previous_textures }
 Texture allocation policy. More...

Public Member Functions

Construction
 CL_TextureGroup ()
 Constructs a null texture group.
 CL_TextureGroup (CL_GraphicContext &context, const CL_Size &texture_sizes)
 Constructs a texture group.
 ~CL_TextureGroup ()
Attributes
bool is_null () const
 Returns false when this texture group has not been set up.
int get_subtexture_count () const
 Returns the amount of sub-textures allocated in group.
int get_subtexture_count (unsigned int texture_index) const
 Returns the amount of sub-textures for a specific texture index.
int get_texture_count () const
 Returns the amount of textures used by group.
TextureAllocationPolicy get_texture_allocation_policy () const
 Returns the texture allocation policy.
CL_Size get_texture_sizes () const
 Returns the size of the textures used by this texture group.
std::vector< CL_Textureget_textures () const
 Returns the textures.
Operations
CL_Subtexture add (CL_GraphicContext &context, const CL_Size &size)
 Allocate space for another sub texture.
void remove (CL_Subtexture &subtexture)
 Deallocate space, from a previously allocated texture.
void set_texture_allocation_policy (TextureAllocationPolicy policy)
 Set the texture allocation policy.
void insert_texture (CL_Texture &texture, const CL_Rect &texture_rect)
 Insert an existing texture into the texture group.


Detailed Description

Texture grouping class.


Member Enumeration Documentation

enum CL_TextureGroup::TextureAllocationPolicy
 

Texture allocation policy.

Enumerator:
create_new_texture 
search_previous_textures 


Constructor & Destructor Documentation

CL_TextureGroup::CL_TextureGroup  ) 
 

Constructs a null texture group.

CL_TextureGroup::CL_TextureGroup CL_GraphicContext context,
const CL_Size texture_sizes
 

Constructs a texture group.

CL_TextureGroup::~CL_TextureGroup  ) 
 


Member Function Documentation

CL_Subtexture CL_TextureGroup::add CL_GraphicContext context,
const CL_Size size
 

Allocate space for another sub texture.

int CL_TextureGroup::get_subtexture_count unsigned int  texture_index  )  const
 

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

int CL_TextureGroup::get_subtexture_count  )  const
 

Returns the amount of sub-textures allocated in group.

TextureAllocationPolicy CL_TextureGroup::get_texture_allocation_policy  )  const
 

Returns the texture allocation policy.

int CL_TextureGroup::get_texture_count  )  const
 

Returns the amount of textures used by group.

CL_Size CL_TextureGroup::get_texture_sizes  )  const
 

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

std::vector<CL_Texture> CL_TextureGroup::get_textures  )  const
 

Returns the textures.

void CL_TextureGroup::insert_texture CL_Texture texture,
const CL_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

bool CL_TextureGroup::is_null  )  const
 

Returns false when this texture group has not been set up.

void CL_TextureGroup::remove CL_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.

void CL_TextureGroup::set_texture_allocation_policy TextureAllocationPolicy  policy  ) 
 

Set the texture allocation policy.


The documentation for this class was generated from the following file:
Generated on Thu Dec 3 02:39:42 2009 for ClanLib by  doxygen 1.4.6