From bc4fd5b051fb9a6631581e9fef63904ab6f5c9b8 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 10 Apr 2003 12:55:48 +0000 Subject: [PATCH] Added usage of Producer::CameraGroup::isValidForRendering() to the Viewer::done() implemention so apps automatically close if one of the windows is killed. --- include/osgProducer/Viewer | 2 +- src/osgProducer/Viewer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/osgProducer/Viewer b/include/osgProducer/Viewer index 540b9560d..8c4644b14 100644 --- a/include/osgProducer/Viewer +++ b/include/osgProducer/Viewer @@ -71,7 +71,7 @@ class OSGPRODUCER_EXPORT Viewer : public OsgCameraGroup, public osgGA::GUIAction void setUpViewer(unsigned int options=STANDARD_SETTINGS); /** return true if the application is done and should exit.*/ - bool done() const; + virtual bool done() const; /** Override the Producer::CameraGroup::setViewByMatrix to catch all changes to view.*/ virtual void setViewByMatrix( const Producer::Matrix & pm); diff --git a/src/osgProducer/Viewer.cpp b/src/osgProducer/Viewer.cpp index 08f0e9c6e..b38be5ea2 100644 --- a/src/osgProducer/Viewer.cpp +++ b/src/osgProducer/Viewer.cpp @@ -174,7 +174,7 @@ unsigned int Viewer::addCameraManipulator(osgGA::CameraManipulator* cm) bool Viewer::done() const { - return _done; + return _done || !validForRendering(); } void Viewer::setViewByMatrix( const Producer::Matrix & pm)