Added virtual bool Texture::isDirty(contextID) method to help determine whether a GL texture object is likely to be out of date and needs updating

This commit is contained in:
Robert Osfield
2018-02-13 12:01:57 +00:00
parent 22d6ce826f
commit b8e5f22cb7
8 changed files with 45 additions and 1 deletions

View File

@@ -70,6 +70,9 @@ class OSG_EXPORT TextureRectangle : public Texture
/** Get the const texture image. */
inline const Image* getImage() const { return _image.get(); }
/** return true if the texture image data has been modified and the associated GL texture object needs to be updated.*/
virtual bool isDirty(unsigned int contextID) const { return (_image.valid() && _image->getModifiedCount()!=_modifiedCount[contextID]); }
inline unsigned int& getModifiedCount(unsigned int contextID) const
{
// get the modified count for the current contextID.