Hi Delport,

I have created a new class inherating the osg::Drawable::UpdateCallback. The 
class structure is as follows:

*****************************************************************************'
class BlurCallback : public osg::Drawable::UpdateCallback
{

public:
    BlurCallback(BlurPass *bp)
        :_bp(bp),
        _blurImage(false)
    {

    }


    virtual void update(osg::NodeVisitor *nv, osg::Drawable *drawable)
    {
        osg::Geometry *geo = dynamic_cast<osg::Geometry*>(drawable);

        osg::StateSet *state = geo->getOrCreateStateSet();

        state->setTextureAttributeAndModes(0, 
_bp->getOutputTexture().get(),osg::StateAttribute::ON);
    }


    BlurPass *_bp;

    mutable bool _blurImage;
};

******************************************************************************'

.............................................
...........................................


polyGeom->setUpdateCallback(bpCallback);




The program crashes when it reaches the viewer.run(); If the comment the above 
code 
the application runs. I think i need to implement some kind of callbacks 
implement what you have suggested in the last post. Isnt it?




Regards
Sajjadul

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=34801#34801





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to