From 9b380c8d495e7336febf0f7f50bcbad4f16e113b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 24 Oct 2011 13:40:29 +0000 Subject: [PATCH] Moved switching off of the cursor till after the slide event handler has had a chance to switch off the scene. --- applications/present3D/present3D.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/applications/present3D/present3D.cpp b/applications/present3D/present3D.cpp index 701b615d0..02d71fb02 100644 --- a/applications/present3D/present3D.cpp +++ b/applications/present3D/present3D.cpp @@ -827,6 +827,19 @@ int main( int argc, char **argv ) viewerInitialized = true; } + // pass the model to the slide event handler so it knows which to manipulate. + seh->set(loadedModel.get()); + seh->selectSlide(0); + + seh->home(); + + if (!outputFileName.empty()) + { + osgDB::writeNodeFile(*loadedModel,outputFileName); + return 0; + } + + if (!cursorFileName.empty()) { // have to add a frame in here to avoid problems with X11 threading issue on switching off the cursor @@ -845,18 +858,6 @@ int main( int argc, char **argv ) } } - // pass the model to the slide event handler so it knows which to manipulate. - seh->set(loadedModel.get()); - seh->selectSlide(0); - - seh->home(); - - if (!outputFileName.empty()) - { - osgDB::writeNodeFile(*loadedModel,outputFileName); - return 0; - } - osg::Timer_t startOfFrameTick = osg::Timer::instance()->tick(); double targetFrameTime = 1.0/targetFrameRate;