From 71874c2dc5158b96d8abfeace0392dcae16fedff Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 23 May 2013 10:25:03 +0000 Subject: [PATCH] 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. --- src/osgWidget/PdfReader.cpp | 5 ++++- src/osgWidget/VncClient.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/osgWidget/PdfReader.cpp b/src/osgWidget/PdfReader.cpp index 9f928c84c..b1a7661ba 100644 --- a/src/osgWidget/PdfReader.cpp +++ b/src/osgWidget/PdfReader.cpp @@ -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 iih = new osgViewer::InteractiveImageHandler(_pdfImage.get()); + + pictureQuad->setEventCallback(iih.get()); + pictureQuad->setCullCallback(iih.get()); addDrawable(pictureQuad); diff --git a/src/osgWidget/VncClient.cpp b/src/osgWidget/VncClient.cpp index 2032c07ae..116da8a85 100644 --- a/src/osgWidget/VncClient.cpp +++ b/src/osgWidget/VncClient.cpp @@ -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 iih = new osgViewer::InteractiveImageHandler(_vncImage.get()); + + pictureQuad->setEventCallback(iih.get()); + pictureQuad->setCullCallback(iih.get()); addDrawable(pictureQuad);