diff --git a/include/osgViewer/ViewerEventHandlers b/include/osgViewer/ViewerEventHandlers index 4831c51a8..f6b875bee 100644 --- a/include/osgViewer/ViewerEventHandlers +++ b/include/osgViewer/ViewerEventHandlers @@ -347,7 +347,10 @@ class OSGVIEWER_EXPORT ScreenCaptureHandler : public osgGA::GUIEventHandler // aa will point to an osgViewer::View, so we will take a screenshot // of that view's graphics contexts. - bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa); + virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa); + + /** Capture the given viewer's views on the next frame. */ + virtual void captureNextFrame(osgViewer::ViewerBase& viewer); /** Get the keyboard and mouse usage of this manipulator.*/ virtual void getUsage(osg::ApplicationUsage& usage) const; diff --git a/src/osgViewer/ScreenCaptureHandler.cpp b/src/osgViewer/ScreenCaptureHandler.cpp index 36c7e0282..ae68f83d4 100644 --- a/src/osgViewer/ScreenCaptureHandler.cpp +++ b/src/osgViewer/ScreenCaptureHandler.cpp @@ -722,6 +722,12 @@ bool ScreenCaptureHandler::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIAc return false; } +/** Capture the given viewer's views on the next frame. */ +void ScreenCaptureHandler::captureNextFrame(osgViewer::ViewerBase& viewer) +{ + addCallbackToViewer(viewer); +} + /** Get the keyboard and mouse usage of this manipulator.*/ void ScreenCaptureHandler::getUsage(osg::ApplicationUsage& usage) const {