RenderAttribRegistry

class RenderAttribRegistry

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.

Inheritance diagram

Inheritance diagram of RenderAttribRegistry

RenderAttribRegistry *get_global_ptr(void)
static constexpr int get_max_slots(void)
int get_num_slots(void) const

Returns the number of RenderAttrib slots that have been allocated. This is one more than the highest slot number in use.

int get_num_sorted_slots(void) const

Returns the number of entries in the sorted_slots list.

int get_slot(TypeHandle type_handle) const

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

RenderAttrib const *get_slot_default(int slot) const

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.

int get_slot_sort(int slot) const

Returns the sort number associated with slot n.

TypeHandle get_slot_type(int slot) const

Returns the TypeHandle associated with slot n.

int get_sorted_slot(int n) const

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.

void set_slot_sort(int slot, int sort)

Changes the sort number associated with slot n.