Added support for ImageSequence to all Texture classes

This commit is contained in:
Robert Osfield
2008-07-22 12:28:46 +00:00
parent 74a1b7881e
commit 5ab73e9f80
10 changed files with 160 additions and 7 deletions

View File

@@ -13,6 +13,7 @@
#include <osg/GLExtensions>
#include <osg/TextureRectangle>
#include <osg/ImageSequence>
#include <osg/State>
#include <osg/GLU>
#include <osg/Notify>
@@ -123,10 +124,24 @@ int TextureRectangle::compare(const StateAttribute& sa) const
void TextureRectangle::setImage(Image* image)
{
if (_image == image) return;
if (dynamic_cast<osg::ImageSequence*>(_image.get()))
{
setUpdateCallback(0);
setDataVariance(osg::Object::STATIC);
}
// delete old texture objects.
dirtyTextureObject();
_image = image;
if (dynamic_cast<osg::ImageSequence*>(_image.get()))
{
setUpdateCallback(new ImageSequence::UpdateCallback());
setDataVariance(osg::Object::DYNAMIC);
}
}