The TextureStagePool (there is only one in the universe) serves to unify different pointers to the same
TextureStage, mainly to help developers use a common pointer to access things that are loaded from different model files.
It runs in one of three different modes, according to
set_mode(). See that method for more information.
Releases only those
TextureStagesin the pool that have a reference count of exactly 1; i.e. only those
TextureStagesthat are not being used outside of the pool. Returns the number of
TextureStage *get_stage(TextureStage *temp)
Each call to get_stage() passing an equivalent
TextureStagepointer will return the same shared pointer.
If you modify the shared pointer, it will automatically disassociate it from the pool.
Also, the return value may be a different pointer than that passed in, or it may be the same pointer. In either case, the passed in pointer has now been sacrificed to the greater good and should not be used again (like any other PointerTo, it will be freed when the last reference count is removed).
void list_contents(std::ostream &out)
Lists the contents of the
TextureStagepool to the indicated output stream.
TextureStagesin the pool and restores the pool to the empty state.
void set_mode(TextureStagePool::Mode mode)
Specifies the fundamental operating mode of the
If this is M_none, each call to
get_stage()returns the same
TextureStagepointer that was passed in (the pool is effectively disabled). If this is M_name, each call to
get_stage()returns the last
TextureStagepassed in with the same name, whether it has different properties or not. If this is M_unique, then each call to
TextureStageswith identical properties.
- int garbage_collect(void)