Added assigned of the InteractiveImageHandler as a cull callback to enable the interactive image to know when it's being actively used as part of rendering a frame.

This commit is contained in:
Robert Osfield
2013-05-23 10:25:03 +00:00
parent 448c93dbe9
commit 71874c2dc5
2 changed files with 8 additions and 2 deletions

View File

@@ -66,7 +66,10 @@ bool PdfReader::assign(PdfImage* pdfImage, const GeometryHints& hints)
texture,
osg::StateAttribute::ON);
pictureQuad->setEventCallback(new osgViewer::InteractiveImageHandler(_pdfImage.get()));
osg::ref_ptr<osgViewer::InteractiveImageHandler> iih = new osgViewer::InteractiveImageHandler(_pdfImage.get());
pictureQuad->setEventCallback(iih.get());
pictureQuad->setCullCallback(iih.get());
addDrawable(pictureQuad);

View File

@@ -61,7 +61,10 @@ bool VncClient::assign(VncImage* vncImage, const GeometryHints& hints)
texture,
osg::StateAttribute::ON);
pictureQuad->setEventCallback(new osgViewer::InteractiveImageHandler(_vncImage.get()));
osg::ref_ptr<osgViewer::InteractiveImageHandler> iih = new osgViewer::InteractiveImageHandler(_vncImage.get());
pictureQuad->setEventCallback(iih.get());
pictureQuad->setCullCallback(iih.get());
addDrawable(pictureQuad);