/**
* Get the current state.
*/
- virtual inline ssgStateSelector *get_state() const { return state; }
+ virtual inline ssgStateSelector *get_state () const { return state; }
/**
- * Add a reference to the texture.
+ * Increment the reference count for this material.
+ *
+ * A material with 0 references may be deleted by the
+ * material library.
+ */
+ virtual inline void ref () { refcount++; }
+
+
+ /**
+ * Decrement the reference count for this material.
*/
- virtual inline void ref() { refcount++; }
+ virtual inline void deRef () { refcount--; }
/**
- * Remove a reference from the texture.
+ * Get the reference count for this material.
+ *
+ * @return The number of references (0 if none).
*/
- virtual inline void deRef() { refcount--; }
+ virtual inline int getRef () const { return refcount; }
+
+protected:
+\f
+ ////////////////////////////////////////////////////////////////////
+ // Protected methods.
+ ////////////////////////////////////////////////////////////////////
/**
- * Get the number of references to the texture.
+ * Initialization method, invoked by all public constructors.
*/
- virtual inline int getRef() const { return refcount; }
+ virtual void init();
private:
ssgSimpleState *textured;
ssgSimpleState *nontextured;
- // alpha texture?
- bool alpha;
-
// texture size
double xsize, ysize;
// Internal constructors and methods.
////////////////////////////////////////////////////////////////////
- FGNewMat ();
FGNewMat (const FGNewMat &mat); // unimplemented
void read_properties (const SGPropertyNode * props);