diff --git a/include/osgViewer/View b/include/osgViewer/View index 54197d062..f6fa669e3 100644 --- a/include/osgViewer/View +++ b/include/osgViewer/View @@ -308,7 +308,10 @@ class OSGVIEWER_EXPORT View : public osg::View, public osgGA::GUIActionAdapter /** Return true if there are pending updates to the scene graph that require an update. */ virtual bool requiresUpdateSceneGraph() const; - public: + /** Return true if there are graphics operations that require a draw of the grpahics context. */ + virtual bool requiresRedraw() const; + +public: osg::Texture* createDistortionTexture(int width, int height); osg::Camera* assignRenderToTextureCamera(osg::GraphicsContext* gc, int width, int height, osg::Texture* texture); diff --git a/src/osgViewer/CompositeViewer.cpp b/src/osgViewer/CompositeViewer.cpp index fe60d91ce..03fddadd5 100644 --- a/src/osgViewer/CompositeViewer.cpp +++ b/src/osgViewer/CompositeViewer.cpp @@ -267,7 +267,7 @@ bool CompositeViewer::checkNeedToDoFrame() ++itr) { osgViewer::View* view = itr->get(); - if (view && view->requiresUpdateSceneGraph()) return true; + if (view && (view->requiresUpdateSceneGraph() || view->requiresRedraw())) return true; } // check if events are available and need processing diff --git a/src/osgViewer/View.cpp b/src/osgViewer/View.cpp index ed4930355..a04433404 100644 --- a/src/osgViewer/View.cpp +++ b/src/osgViewer/View.cpp @@ -1138,13 +1138,18 @@ bool View::requiresUpdateSceneGraph() const // check if the scene requires an update traversal if (_scene.valid() && _scene->requiresUpdateSceneGraph()) return true; - // check if the scene requires a redraw - // FIXME... - if (_scene.valid() && _scene->requiresRedraw()) return true; return false; } +bool View::requiresRedraw() const +{ + // check if the scene requires a redraw + if (_scene.valid() && _scene->requiresRedraw()) return true; + return false; +} + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Methods that support Stereo and Keystone correction. diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index 81ca112bb..64a99d084 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -379,6 +379,9 @@ bool Viewer::checkNeedToDoFrame() // check if the view needs to update the scene graph if (requiresUpdateSceneGraph()) return true; + // check if the view needs to be redraw + if (requiresRedraw()) return true; + // check if events are available and need processing if (checkEvents()) return true;