#include <materialPool.h>
Static Public Member Functions | |
const Material * | get_material (const ConstPointerTo< Material > &temp) |
int | garbage_collect () |
Releases only those materials in the pool that have a reference count of exactly 1; i.e. | |
void | list_contents (ostream &out) |
Lists the contents of the material pool to the indicated output stream. | |
Private Types | |
typedef pset< ConstPointerTo< Material >, IndirectCompareTo< Material > > | Materials |
Private Member Functions | |
MaterialPool () | |
The constructor is not intended to be called directly; there's only supposed to be one MaterialPool in the universe and it constructs itself. | |
const Material * | ns_get_material (const ConstPointerTo< Material > &temp) |
The nonstatic implementation of get_material(). | |
int | ns_garbage_collect () |
The nonstatic implementation of garbage_collect(). | |
void | ns_list_contents (ostream &out) |
The nonstatic implementation of list_contents(). | |
Static Private Member Functions | |
MaterialPool * | get_ptr () |
Initializes and/or returns the global pointer to the one MaterialPool object in the system. | |
Private Attributes | |
Materials | _materials |
Static Private Attributes | |
MaterialPool * | _global_ptr = (MaterialPool *)NULL |
The idea is to create a temporary Material representing the lighting state you want to apply, then call get_material(), passing in your temporary Material. The return value will be a constant Material object that should be modified (because it is now shared among many different geometries), that is the same as the temporary Material pointer you supplied but may be a different pointer.
Definition at line 71 of file materialPool.h.
|
Definition at line 87 of file materialPool.h. |
|
The constructor is not intended to be called directly; there's only supposed to be one MaterialPool in the universe and it constructs itself.
Definition at line 119 of file materialPool.I. |
|
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. Definition at line 87 of file materialPool.I. |
|
Referenced by NodePath::set_color_off(). |
|
Initializes and/or returns the global pointer to the one MaterialPool object in the system.
Definition at line 104 of file materialPool.cxx. |
|
Lists the contents of the material pool to the indicated output stream.
Definition at line 102 of file materialPool.I. |
|
The nonstatic implementation of garbage_collect().
Definition at line 52 of file materialPool.cxx. |
|
The nonstatic implementation of get_material().
Definition at line 38 of file materialPool.cxx. References _materials, and ReferenceCount::get_ref_count(). |
|
The nonstatic implementation of list_contents().
Definition at line 83 of file materialPool.cxx. References _global_ptr, and NULL. |
|
Definition at line 26 of file materialPool.cxx. Referenced by ns_list_contents(). |
|
Definition at line 88 of file materialPool.h. Referenced by ns_get_material(). |