From 9d883176f91970a707c96a2db4a35a2e3aad86ee Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 21 Nov 2003 14:17:26 +0000 Subject: [PATCH] Changed the main to create a Group and then add the loaded scene and HUD scene into this. This has been done to rework code nearer to what Stephan Huber used to get round a crash under OSX when a model was passed in. This crash suggest a problem in dynamic_cast<> perhaps? --- examples/osghud/osghud.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/examples/osghud/osghud.cpp b/examples/osghud/osghud.cpp index 9e3f8d985..d98ca8b6e 100644 --- a/examples/osghud/osghud.cpp +++ b/examples/osghud/osghud.cpp @@ -201,14 +201,10 @@ int main( int argc, char **argv ) // read the scene from the list of file specified commandline args. osg::ref_ptr scene = osgDB::readNodeFiles(arguments); - osg::ref_ptr group = dynamic_cast(scene.get()); - if (!group) - { - group = new osg::Group; - group->addChild(scene.get()); - } - + osg::ref_ptr group = new osg::Group; + // add the HUD subgraph. + if (scene.valid()) group->addChild(scene.get()); group->addChild(createHUD()); // set the scene to render