+class fntFont;
+class DCLGPS;
+class IntRect;
+
+////////////////////////////////////////////////////////////////////////
+// Texture management.
+////////////////////////////////////////////////////////////////////////
+
+
+/**
+ * Texture manager (should migrate out into FGFS).
+ *
+ * This class ensures that no texture is loaded more than once.
+ */
+class FGTextureManager
+{
+public:
+ static osg::Texture2D* createTexture(const std::string &relativePath,
+ bool staticTexture = true);
+ static void addTexture(const std::string &relativePath, osg::Texture2D* texture);
+private:
+ static std::map<std::string,osg::ref_ptr<osg::Texture2D> > _textureMap;
+};
+
+
+/**
+ * Cropped texture (should migrate out into FGFS).
+ *
+ * This structure wraps an SSG texture with cropping information.
+ */
+class FGCroppedTexture
+{
+public:
+
+ FGCroppedTexture ();
+ FGCroppedTexture (const std::string &path,
+ float _minX = 0.0, float _minY = 0.0,
+ float _maxX = 1.0, float _maxY = 1.0);
+ virtual ~FGCroppedTexture ();
+
+ virtual void setPath (const std::string &path) { _path = path; }
+
+ virtual const std::string &getPath () const { return _path; }
+
+ virtual osg::StateSet* getTexture ();
+
+ virtual void setCrop (float minX, float minY, float maxX, float maxY) {
+ _minX = minX; _minY = minY; _maxX = maxX; _maxY = maxY;
+ }
+
+ virtual float getMinX () const { return _minX; }
+ virtual float getMinY () const { return _minY; }
+ virtual float getMaxX () const { return _maxX; }
+ virtual float getMaxY () const { return _maxY; }
+
+
+private:
+ std::string _path;
+ osg::ref_ptr<osg::StateSet> _texture;
+ float _minX, _minY, _maxX, _maxY;
+};
+