]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/material/mat.hxx
Memory leak fixes from Till Busch
[simgear.git] / simgear / scene / material / mat.hxx
index 648abcab5f61602a84ced38fe71d858ead20605a..0a0fbd13289c7781140497307ddad3fdf20b7393 100644 (file)
@@ -43,6 +43,7 @@
 
 #include <simgear/props/props.hxx>
 #include <simgear/structure/SGSharedPtr.hxx>
+#include <simgear/scene/util/SGSceneFeatures.hxx>
 
 #include "matmodel.hxx"
 
@@ -53,18 +54,6 @@ SG_USING_STD(map);
 
 class SGMaterialGlyph;
 
-class SGTextureFilterListener  {
-private:
-  static int filter;
-
-  SGTextureFilterListener() {
-  }
-  
-public:
-  static int getFilter();
-  static void setFilter(int filt);
- };
-
 /**
  * A material in the scene graph.
  *
@@ -124,18 +113,10 @@ public:
   // Public methods.
   ////////////////////////////////////////////////////////////////////
 
-  /**
-   * Force the texture to load if it hasn't already.
-   *
-   * @return true if the texture loaded, false if it was loaded
-   * already.
-   */
-  bool load_texture (int n = -1);
-
   /**
    * Get the textured state.
    */
-  osg::StateSet *get_state (int n = -1) const;
+  osg::StateSet *get_state (int n = -1);
 
 
   /**
@@ -342,7 +323,15 @@ public:
   const SGMaterial* getMaterial() const
   { return mMaterial; }
 private:
-  SGSharedPtr<const SGMaterial> mMaterial;
+  // this cannot be an SGSharedPtr since that would create a cicrular reference
+  // making it impossible to ever free the space needed by SGMaterial
+  const SGMaterial* mMaterial;
 };
 
+void
+SGSetTextureFilter( int max);
+
+int
+SGGetTextureFilter();
+
 #endif // _SG_MAT_HXX