Hasty Badger
Small UI library (a branch of Turbo Badger)
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends Groups Pages
tb::TBBitmapFragment Class Reference

TBBitmapFragment represents a sub part of a TBBitmap. More...

#include <tb_bitmap_fragment.h>

Public Member Functions

int Width () const
 Return the width of the bitmap fragment. More...
 
int Height () const
 Return the height of the bitmap fragment. More...
 
TBBitmapGetBitmap (TB_VALIDATE_TYPE validate_type=TB_VALIDATE_ALWAYS)
 Return the bitmap for this fragment. More...
 
int GetAllocatedHeight () const
 Return the height allocated to this fragment. More...
 

Public Attributes

TBBitmapFragmentMapm_map
 
TBRect m_rect
 
TBFragmentSpaceAllocatorm_row
 
TBFragmentSpaceAllocator::Space * m_space
 
TBID m_id
 
int m_row_height
 
uint32_t m_batch_id
 This uint32_t is reserved for batching renderer backends. More...
 

Detailed Description

TBBitmapFragment represents a sub part of a TBBitmap.

It's owned by TBBitmapFragmentManager which pack multiple TBBitmapFragment within TBBitmaps to reduce texture switching.

Member Function Documentation

int tb::TBBitmapFragment::GetAllocatedHeight ( ) const
inline

Return the height allocated to this fragment.

This may be larger than Height() depending of the internal allocation of fragments in a map. It should rarely be used.

TBBitmap* tb::TBBitmapFragment::GetBitmap ( TB_VALIDATE_TYPE  validate_type = TB_VALIDATE_ALWAYS)
inline

Return the bitmap for this fragment.

By default, the bitmap is validated if needed before returning (See TB_VALIDATE_TYPE)

int tb::TBBitmapFragment::Height ( ) const
inline

Return the height of the bitmap fragment.

int tb::TBBitmapFragment::Width ( ) const
inline

Return the width of the bitmap fragment.

Member Data Documentation

uint32_t tb::TBBitmapFragment::m_batch_id

This uint32_t is reserved for batching renderer backends.

It's not used internally, but always initialized to 0xffffffff for all new fragments.


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