25 if (type_index >= (
int)_slots_by_type.size()) {
28 return _slots_by_type[type_index];
58 return _registry.size();
69 return _registry[slot]._type;
79 nassertr(slot >= 0 && slot < (
int)_registry.size(), 0);
80 return _registry[slot]._sort;
91 return _sorted_slots.size();
103 nassertr(n >= 0 && n < (
int)_sorted_slots.size(), 0);
104 return _sorted_slots[n];
150 INLINE RenderAttribRegistry::SortSlots::
159 INLINE
bool RenderAttribRegistry::SortSlots::
160 operator () (
int a,
int b)
const {
161 return _reg->get_slot_sort(a) < _reg->get_slot_sort(b);
int get_slot(TypeHandle type_handle) const
Returns the slot number assigned to the indicated TypeHandle, or 0 if no slot number has been assigne...
static TypeHandle none()
Returns a special zero-valued TypeHandle that is used to indicate no type.
int get_index() const
Returns the integer index associated with this TypeHandle.
int get_num_sorted_slots() const
Returns the number of entries in the sorted_slots list.
DeletedBufferChain * get_array_chain() const
Returns the DeletedBufferChain object that may be used to allocated appropriately-sized arrays of Ren...
int get_slot_sort(int slot) const
Returns the sort number associated with slot n.
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.
int get_num_slots() const
Returns the number of RenderAttrib slots that have been allocated.
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.
TypeHandle is the identifier used to differentiate C++ class types.
This template class can be used to provide faster allocation/deallocation for many Panda objects...
static RenderAttribRegistry * quick_get_global_ptr()
Returns the global_ptr without first ensuring it has been initialized.
int get_max_slots() const
Returns the maximum number that any slot number is allowed to grow.