Show
Ignore:
Timestamp:
06/17/10 16:28:16 (5 years ago)
Author:
robert
Message:

From Nguyen Van Truong, fix for passing of events to slaves

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgcluster/osgcluster.cpp

    r11622 r11623  
    409409    _events.clear(); 
    410410 
     411    osgViewer::ViewerBase::Contexts contexts; 
     412    viewer.getContexts(contexts);    
     413 
     414    for(osgViewer::ViewerBase::Contexts::iterator citr =contexts.begin();  citr != contexts.end(); ++citr) 
     415    { 
     416        osgGA::EventQueue::Events gw_events; 
     417 
     418        osgViewer::GraphicsWindow* gw = dynamic_cast<osgViewer::GraphicsWindow*>(*citr); 
     419        if (gw) 
     420        { 
     421            gw->checkEvents(); 
     422            gw->getEventQueue()->copyEvents(gw_events); 
     423        } 
     424        _events.insert(_events.end(), gw_events.begin(), gw_events.end()); 
     425    } 
     426     
    411427    viewer.getEventQueue()->copyEvents(_events); 
    412428