14#ifndef RENDERATTRIBREGISTRY_H
15#define RENDERATTRIBREGISTRY_H
31class EXPCL_PANDA_PGRAPH RenderAttribRegistry {
33 RenderAttribRegistry();
34 ~RenderAttribRegistry();
46 typedef BitMask32 SlotMask;
50 static const int _max_slots = 32;
57 static constexpr int get_max_slots() {
return _max_slots; }
68 INLINE
static RenderAttribRegistry *get_global_ptr();
74 static void init_global_ptr();
79 INLINE SortSlots(RenderAttribRegistry *reg);
80 INLINE
bool operator () (
int a,
int b)
const;
81 RenderAttribRegistry *_reg;
93 typedef pvector<RegistryNode> Registry;
96 vector_int _slots_by_type;
97 vector_int _sorted_slots;
99 static RenderAttribRegistry *_global_ptr;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This template class can be used to provide faster allocation/deallocation for many Panda objects.
const RenderAttrib * get_slot_default(int slot) const
Returns the default RenderAttrib object associated with slot n.
static RenderAttribRegistry * quick_get_global_ptr()
Returns the global_ptr without first ensuring it has been initialized.
int get_slot_sort(int slot) const
Returns the sort number associated with slot n.
int get_sorted_slot(int n) const
Returns the nth slot in sorted order.
int get_num_slots() const
Returns the number of RenderAttrib slots that have been allocated.
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...
int get_num_sorted_slots() const
Returns the number of entries in the sorted_slots list.
void set_slot_sort(int slot, int sort)
Changes the sort number associated with slot n.
TypeHandle get_slot_type(int slot) const
Returns the TypeHandle associated with slot n.
int register_slot(TypeHandle type_handle, int sort, RenderAttrib *default_attrib)
Adds the indicated TypeHandle to the registry, if it is not there already, and returns a unique slot ...
This is the base class for a number of render attributes (other than transform) that may be set on sc...
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.