Show
Ignore:
Timestamp:
01/07/10 13:14:47 (4 years ago)
Author:
robert
Message:

Refactored the way that osg::Image/ImageSequence manages the update callback that needs to be attached to Textures to make it possible to use the Image::update() mechansim in other subclasses from osg::Image.
To enable the automatic attachment of the required update callback to call osg::Image::update(..) subclasses from osg::Image will
need to implement the osg::Image::requestUpdateCall() and return true, and implement the osg::Image::update(NodeVisitor?*) method to recieve the update call during the update traversal.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osg/Texture1D.cpp

    r10867 r10924  
    1313#include <osg/GLExtensions> 
    1414#include <osg/Texture1D> 
    15 #include <osg/ImageSequence> 
    1615#include <osg/State> 
    1716#include <osg/GLU> 
     
    9897    if (_image == image) return; 
    9998 
    100     if (dynamic_cast<osg::ImageSequence*>(_image.get())) 
     99    if (_image.valid() && _image->requiresUpdateCall()) 
    101100    { 
    102101        setUpdateCallback(0); 
     
    110109    _modifiedCount.setAllElementsTo(0); 
    111110     
    112     if (dynamic_cast<osg::ImageSequence*>(_image.get())) 
    113     { 
    114         setUpdateCallback(new ImageSequence::UpdateCallback()); 
     111    if (_image.valid() && _image->requiresUpdateCall()) 
     112    { 
     113        setUpdateCallback(new Image::UpdateCallback()); 
    115114        setDataVariance(osg::Object::DYNAMIC); 
    116115    }