Commits

rob...@16af8721-9629-0410-8352-f15c8da7e697  committed 0e962f8 Draft

Moved the frame() event into the event traversal after then events and their state have been accumulated.

  • Participants
  • Parent commits 0e08b05

Comments (0)

Files changed (1)

File src/osgViewer/Viewer.cpp

         _frameStamp->setSimulationTime(simulationTime);
     }
 
-    if (_eventQueue.valid())
-    {
-        osgGA::GUIEventAdapter* eventState = getEventQueue()->getCurrentEventState();
-        if (getCamera()->getViewport())
-        {
-            osg::Viewport* viewport = getCamera()->getViewport();
-            eventState->setInputRange( viewport->x(), viewport->y(), viewport->x() + viewport->width(), viewport->y() + viewport->height());
-        }
-        else
-        {
-            eventState->setInputRange(-1.0, -1.0, 1.0, 1.0);
-        }
-
-        _eventQueue->frame( getFrameStamp()->getReferenceTime() );
-    }
-
     if (getViewerStats() && getViewerStats()->collectStats("frame_rate"))
     {
         // update previous frame stats
         }
     }
 
+    _eventQueue->frame( getFrameStamp()->getReferenceTime() );
 
     // OSG_NOTICE<<"mouseEventState Xmin = "<<eventState->getXmin()<<" Ymin="<<eventState->getYmin()<<" xMax="<<eventState->getXmax()<<" Ymax="<<eventState->getYmax()<<std::endl;