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/TextureRectangle.cpp

    r10867 r10924  
    1414#include <osg/GLExtensions> 
    1515#include <osg/TextureRectangle> 
    16 #include <osg/ImageSequence> 
    1716#include <osg/State> 
    1817#include <osg/GLU> 
     
    127126    if (_image == image) return; 
    128127 
    129     if (dynamic_cast<osg::ImageSequence*>(_image.get())) 
     128    if (_image.valid() && _image->requiresUpdateCall()) 
    130129    { 
    131130        setUpdateCallback(0); 
     
    137136 
    138137    _image = image; 
    139      
    140     if (dynamic_cast<osg::ImageSequence*>(_image.get())) 
    141     { 
    142         setUpdateCallback(new ImageSequence::UpdateCallback()); 
     138 
     139    if (_image.valid() && _image->requiresUpdateCall()) 
     140    { 
     141        setUpdateCallback(new Image::UpdateCallback()); 
    143142        setDataVariance(osg::Object::DYNAMIC); 
    144143    }