garbageCollect static int MaterialPool::garbage_collect(void); Description: Releases only those materials in the pool that have a reference count of exactly 1; i.e. only those materials that are not being used outside of the pool. Returns the number of materials released. |
getMaterial static Material *MaterialPool::get_material(Material *temp); Description: Returns a Material pointer that represents the same material described by temp, except that it is a shared pointer. Each call to get_material() passing an equivalent Material pointer 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). |
listContents static void MaterialPool::list_contents(ostream &out); Description: Lists the contents of the material pool to the indicated output stream. |
write static void MaterialPool::write(ostream &out); Description: Lists the contents of the material pool to the indicated output stream. |