15 #include "graphicsStateGuardianBase.h" 16 #include "lightMutexHolder.h" 22 TypeHandle GraphicsStateGuardianBase::_type_handle;
51 if (find(_gsgs.begin(), _gsgs.end(), default_gsg) == _gsgs.end()) {
57 _default_gsg = default_gsg;
79 nassertr(n >= 0 && n < (
int)_gsgs.size(), NULL);
93 if (find(_gsgs.begin(), _gsgs.end(), gsg) != _gsgs.end()) {
115 GSGs::iterator gi = find(_gsgs.begin(), _gsgs.end(), gsg);
116 if (gi == _gsgs.end()) {
123 if (_default_gsg == gsg) {
124 if (!_gsgs.empty()) {
125 _default_gsg = *_gsgs.begin();
static void remove_gsg(GraphicsStateGuardianBase *gsg)
Called by a GSG destructor to remove a GSG from the available list.
This is our own Panda specialization on the default STL vector.
Similar to MutexHolder, but for a light mutex.
static GraphicsStateGuardianBase * get_default_gsg()
Returns a pointer to the "default" GSG.
static GraphicsStateGuardianBase * get_gsg(int n)
Returns the nth GSG in the universe.
static int get_num_gsgs()
Returns the total number of GSG's in the universe.
static void set_default_gsg(GraphicsStateGuardianBase *default_gsg)
Specifies a particular GSG to use as the "default" GSG.
static void add_gsg(GraphicsStateGuardianBase *gsg)
Called by a GSG after it has been initialized, to add a new GSG to the available list.
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
TypeHandle is the identifier used to differentiate C++ class types.
This is a standard, non-reentrant mutex, similar to the Mutex class.