Canvas: Fully remove Window drawable if destroyed
This commit is contained in:
parent
d6a5a911bc
commit
052d578483
2 changed files with 9 additions and 1 deletions
|
@ -24,6 +24,8 @@
|
||||||
#include <osg/Texture2D>
|
#include <osg/Texture2D>
|
||||||
#include <osgGA/GUIEventHandler>
|
#include <osgGA/GUIEventHandler>
|
||||||
|
|
||||||
|
#include <boost/foreach.hpp>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback to enable/disable rendering of canvas displayed inside windows
|
* Callback to enable/disable rendering of canvas displayed inside windows
|
||||||
*/
|
*/
|
||||||
|
@ -108,7 +110,12 @@ namespace canvas
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
Window::~Window()
|
Window::~Window()
|
||||||
{
|
{
|
||||||
|
BOOST_FOREACH(osg::Node* parent, _geometry->getParents())
|
||||||
|
{
|
||||||
|
osg::Geode* geode = dynamic_cast<osg::Geode*>(parent);
|
||||||
|
if( geode )
|
||||||
|
geode->removeDrawable(_geometry);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include <simgear/props/propertyObject.hxx>
|
#include <simgear/props/propertyObject.hxx>
|
||||||
|
|
||||||
|
#include <osg/Geode>
|
||||||
#include <osg/Geometry>
|
#include <osg/Geometry>
|
||||||
|
|
||||||
namespace canvas
|
namespace canvas
|
||||||
|
|
Loading…
Add table
Reference in a new issue