Added osg::Image::dirtyImage() and setModifiedTag() to allow external
updating of the image modified flag to be used in conjunction with texture subloading.
This commit is contained in:
parent
3ff4fb6b50
commit
969f757679
@ -69,7 +69,13 @@ class SG_EXPORT Image : public Object
|
|||||||
*/
|
*/
|
||||||
void ensureDimensionsArePowerOfTwo();
|
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; }
|
inline const unsigned int getModifiedTag() const { return _modifiedTag; }
|
||||||
|
|
||||||
protected :
|
protected :
|
||||||
|
@ -22,6 +22,8 @@ Image::Image()
|
|||||||
_packing = 4;
|
_packing = 4;
|
||||||
|
|
||||||
_data = (unsigned char *)0L;
|
_data = (unsigned char *)0L;
|
||||||
|
|
||||||
|
_modifiedTag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -69,6 +71,8 @@ void Image::setImage(const int s,const int t,const int r,
|
|||||||
// test scaling...
|
// test scaling...
|
||||||
// scaleImageTo(16,16,_r);
|
// scaleImageTo(16,16,_r);
|
||||||
|
|
||||||
|
++_modifiedTag;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Image::scaleImage(const int s,const int t,const int /*r*/)
|
void Image::scaleImage(const int s,const int t,const int /*r*/)
|
||||||
@ -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 = "<<gluErrorString((GLenum)status)<<endl;
|
notify(WARN) << "Error Image::scaleImage() do not succeed : errorString = "<<gluErrorString((GLenum)status)<<endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
++_modifiedTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user