Hi,
On 14/12/10 02:46, Sajjadul Islam wrote:
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?
You can for a start just do it when you modify the switch using the
keyboard. The callback will be called every frame, so I don't think that
is what you want.
jp
Regards
Sajjadul
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=34801#34801
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org