Show
Ignore:
Timestamp:
08/22/14 21:00:53 (7 hours ago)
Author:
robert
Message:

Improved handling of setting of the depth of the UI.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgViewer/Viewer.cpp

    r13413 r13429  
    362362    if (getSceneData()!=0 && getSceneData()->getNumChildrenRequiringUpdateTraversal()>0) return true; 
    363363 
    364     // now do a eventTraversal to see if any events might require a new frame. 
    365     eventTraversal(); 
    366  
     364    // check if events are available and need processing 
     365    if (checkEvents()) return true; 
     366     
    367367    // now check if any of the event handles have prompted a redraw. 
    368368    if (_requestRedraw) return true; 
    369369    if (_requestContinousUpdate) return true; 
    370370 
     371    return false; 
     372} 
     373 
     374bool Viewer::checkEvents() 
     375{ 
     376    // check events from any attached sources 
     377    for(Devices::iterator eitr = _eventSources.begin(); 
     378        eitr != _eventSources.end(); 
     379        ++eitr) 
     380    { 
     381        osgGA::Device* es = eitr->get(); 
     382        if (es->getCapabilities() & osgGA::Device::RECEIVE_EVENTS) 
     383        { 
     384            if (es->checkEvents()) return true; 
     385        } 
     386 
     387    } 
     388 
     389    // get events from all windows attached to Viewer. 
     390    Windows windows; 
     391    getWindows(windows); 
     392    for(Windows::iterator witr = windows.begin(); 
     393        witr != windows.end(); 
     394        ++witr) 
     395    { 
     396        if ((*witr)->checkEvents()) return true; 
     397    } 
     398     
    371399    return false; 
    372400} 
     
    799827    if (_done) return; 
    800828 
     829#if 1 
     830    double cutOffTime = _frameStamp->getReferenceTime(); 
     831#else     
    801832    double cutOffTime = (_runFrameScheme==ON_DEMAND) ? DBL_MAX : _frameStamp->getReferenceTime(); 
    802  
     833#endif 
     834     
    803835    double beginEventTraversal = osg::Timer::instance()->delta_s(_startTick, osg::Timer::instance()->tick()); 
    804836