diff --git a/include/osg/Image b/include/osg/Image index 7df96c63f..228041520 100644 --- a/include/osg/Image +++ b/include/osg/Image @@ -69,7 +69,13 @@ class SG_EXPORT Image : public Object */ void ensureDimensionsArePowerOfTwo(); - /** Get modified tag value. */ + /** Dirty the image, which increments the modified flag, to force osg::Texture to reload the image.*/ + inline void dirtyImage() { ++_modifiedTag; } + + /** Set the modified tag value, only used by osg::Texture when using texture subloading. */ + inline void setModifiedTag(const unsigned int value) { _modifiedTag=value; } + + /** Get modified tag value, only used by osg::Texture when using texture subloading. */ inline const unsigned int getModifiedTag() const { return _modifiedTag; } protected : diff --git a/src/osg/Image.cpp b/src/osg/Image.cpp index 555ae68c4..10eaceec6 100644 --- a/src/osg/Image.cpp +++ b/src/osg/Image.cpp @@ -22,6 +22,8 @@ Image::Image() _packing = 4; _data = (unsigned char *)0L; + + _modifiedTag = 0; } @@ -68,6 +70,8 @@ void Image::setImage(const int s,const int t,const int r, // test scaling... // scaleImageTo(16,16,_r); + + ++_modifiedTag; } @@ -106,6 +110,8 @@ void Image::scaleImage(const int s,const int t,const int /*r*/) notify(WARN) << "Error Image::scaleImage() do not succeed : errorString = "<