21 if (type_index >= (
int)_slots_by_type.size()) {
24 return _slots_by_type[(size_t)type_index];
33 return _registry.size();
41 nassertr(slot >= 0 && slot < (
int)_registry.size(), TypeHandle::none());
42 return _registry[slot]._type;
50 nassertr(slot >= 0 && slot < (
int)_registry.size(), 0);
51 return _registry[slot]._sort;
61 nassertr(slot >= 0 && slot < (
int)_registry.size(), 0);
62 return _registry[slot]._default_attrib;
70 return _sorted_slots.size();
80 nassertr(n >= 0 && n < (
int)_sorted_slots.size(), 0);
81 return _sorted_slots[n];
89 if (_global_ptr ==
nullptr) {
108 INLINE RenderAttribRegistry::SortSlots::
115 INLINE
bool RenderAttribRegistry::SortSlots::
116 operator () (
int a,
int b)
const {
117 return _reg->get_slot_sort(a) < _reg->get_slot_sort(b);
123 INLINE RenderAttribRegistry::RegistryNode::
127 _default_attrib(default_attrib) {
TypeHandle get_slot_type(int slot) const
Returns the TypeHandle associated with slot n.
This is the base class for a number of render attributes (other than transform) that may be set on sc...
int get_num_slots() const
Returns the number of RenderAttrib slots that have been allocated.
int get_slot_sort(int slot) const
Returns the sort number associated with slot n.
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...
This class is used to associate each RenderAttrib with a different slot index at runtime,...
int get_sorted_slot(int n) const
Returns the nth slot in sorted order.
get_index
Returns the integer index associated with this TypeHandle.
int get_num_sorted_slots() const
Returns the number of entries in the sorted_slots list.
const RenderAttrib * get_slot_default(int slot) const
Returns the default RenderAttrib object associated with slot n.
TypeHandle is the identifier used to differentiate C++ class types.
static RenderAttribRegistry * quick_get_global_ptr()
Returns the global_ptr without first ensuring it has been initialized.