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:
@@ -63,6 +63,16 @@ class OSG_EXPORT Texture2DArray : public Texture
|
||||
*/
|
||||
virtual unsigned int getNumImages() const { return _images.size(); }
|
||||
|
||||
/** 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
|
||||
{
|
||||
for(unsigned int i=0; i<_images.size(); ++i)
|
||||
{
|
||||
if (_images[i].valid() && _images[i]->getModifiedCount()!=_modifiedCount[i][contextID]) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Check how often was a certain layer in the given context modified */
|
||||
inline unsigned int& getModifiedCount(unsigned int layer, unsigned int contextID) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user