25 write(std::ostream &out) {
26 get_global_ptr()->ns_list_contents(out);
37 Materials::iterator mi = _materials.find(cpttemp);
38 if (mi == _materials.end()) {
39 mi = _materials.insert(Materials::value_type(
new Material(*temp), temp)).first;
41 if (*(*mi).first != *(*mi).second) {
53 ns_release_material(
Material *temp) {
57 _materials.erase(cpttemp);
64 ns_release_all_materials() {
74 ns_garbage_collect() {
80 Materials::iterator mi;
81 for (mi = _materials.begin(); mi != _materials.end(); ++mi) {
85 if (gobj_cat.is_debug()) {
87 <<
"Releasing " << *mat1 <<
"\n";
91 new_set.insert(new_set.end(), *mi);
95 _materials.swap(new_set);
103 ns_list_contents(std::ostream &out)
const {
106 out << _materials.size() <<
" materials:\n";
107 Materials::const_iterator mi;
108 for (mi = _materials.begin(); mi != _materials.end(); ++mi) {
122 if (_global_ptr ==
nullptr) {
Similar to MutexHolder, but for a light mutex.
The MaterialPool (there is only one in the universe) serves to unify different pointers to the same M...
static void write(std::ostream &out)
Lists the contents of the material pool to the indicated output stream.
Defines the way an object appears in the presence of lighting.
get_ref_count
Returns the current reference count.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.