Panda3D
Public Member Functions | Static Public Member Functions | List of all members
RenderAttribRegistry Class Reference

This class is used to associate each RenderAttrib with a different slot index at runtime, so we can store a list of RenderAttribs in the RenderState object, and very quickly look them up by type. More...

Public Member Functions

int getNumSlots ()
 Returns the number of RenderAttrib slots that have been allocated. More...
 
int getNumSortedSlots ()
 Returns the number of entries in the sorted_slots list. More...
 
int getSlot (TypeHandle type_handle)
 Returns the slot number assigned to the indicated TypeHandle, or 0 if no slot number has been assigned. More...
 
const RenderAttrib getSlotDefault (int slot)
 Returns the default RenderAttrib object associated with slot n. More...
 
int getSlotSort (int slot)
 Returns the sort number associated with slot n. More...
 
TypeHandle getSlotType (int slot)
 Returns the TypeHandle associated with slot n. More...
 
int getSortedSlot (int n)
 Returns the nth slot in sorted order. More...
 
 setSlotSort (int slot, int sort)
 Changes the sort number associated with slot n. More...
 

Static Public Member Functions

static RenderAttribRegistry getGlobalPtr ()
 
static int getMaxSlots ()
 

Detailed Description

This class is used to associate each RenderAttrib with a different slot index at runtime, so we can store a list of RenderAttribs in the RenderState object, and very quickly look them up by type.

Member Function Documentation

◆ getGlobalPtr()

static RenderAttribRegistry getGlobalPtr ( )
static

◆ getMaxSlots()

static int getMaxSlots ( )
static

◆ getNumSlots()

int getNumSlots ( )

Returns the number of RenderAttrib slots that have been allocated.

This is one more than the highest slot number in use.

◆ getNumSortedSlots()

int getNumSortedSlots ( )

Returns the number of entries in the sorted_slots list.

◆ getSlot()

int getSlot ( TypeHandle  type_handle)

Returns the slot number assigned to the indicated TypeHandle, or 0 if no slot number has been assigned.

◆ getSlotDefault()

const RenderAttrib getSlotDefault ( int  slot)

Returns the default RenderAttrib object associated with slot n.

This is the attrib that should be applied in the absence of any other attrib of this type.

◆ getSlotSort()

int getSlotSort ( int  slot)

Returns the sort number associated with slot n.

◆ getSlotType()

TypeHandle getSlotType ( int  slot)

Returns the TypeHandle associated with slot n.

◆ getSortedSlot()

int getSortedSlot ( int  n)

Returns the nth slot in sorted order.

By traversing this list, you will retrieve all the slot numbers in order according to their registered sort value.

◆ setSlotSort()

setSlotSort ( int  slot,
int  sort 
)

Changes the sort number associated with slot n.