#include <map> // STL associative "array"
#include <vector> // STL "array"
-#include <plib/ssg.h> // plib include
-
+#include <osg/Node>
+#include <osg/StateSet>
class SGMaterial;
SG_USING_STD(vector);
SG_USING_STD(less);
-
// Material management class
class SGMaterialLib {
private:
// associative array of materials
- typedef map < string, SGSharedPtr<SGMaterial>, less<string> > material_map;
+ typedef map < string, SGSharedPtr<SGMaterial> > material_map;
typedef material_map::iterator material_map_iterator;
typedef material_map::const_iterator const_material_map_iterator;
// Add the named texture with default properties
bool add_item( const string &tex_path );
bool add_item( const string &mat_name, const string &tex_path );
- bool add_item( const string &mat_name, ssgSimpleState *state );
+ bool add_item( const string &mat_name, osg::StateSet *state );
// find a material record by material name
SGMaterial *find( const string& material );
- /**
- * Load the next deferred texture, if there is any.
- */
- void load_next_deferred();
-
material_map_iterator begin() { return matlib.begin(); }
const_material_map_iterator begin() const { return matlib.begin(); }
material_map_iterator end() { return matlib.end(); }
const_material_map_iterator end() const { return matlib.end(); }
- bool find( ssgSimpleState*, string & material ) const;
+ const SGMaterial* findMaterial(const osg::StateSet* stateSet) const;
// Destructor
~SGMaterialLib ( void );