Show
Ignore:
Timestamp:
01/07/10 13:14:47 (5 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/Image.cpp

    r10866 r10924  
    6363using namespace osg; 
    6464using namespace std; 
     65 
     66void Image::UpdateCallback::operator () (osg::StateAttribute* attr, osg::NodeVisitor* nv) 
     67{ 
     68    osg::Texture* texture = attr ? attr->asTexture() : 0; 
     69 
     70    // osg::notify(osg::NOTICE)<<"ImageSequence::UpdateCallback::"<<texture<<std::endl; 
     71    if (texture) 
     72    { 
     73        for(unsigned int i=0; i<texture->getNumImages(); ++i) 
     74        { 
     75            texture->getImage(i)->update(nv); 
     76        } 
     77    } 
     78} 
    6579 
    6680Image::Image()