Show
Ignore:
Timestamp:
08/29/05 16:05:30 (9 years ago)
Author:
robert
Message:

Improved support for keyboard/mouse events in osgcluster.

Files:
1 modified

Legend:

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

    r4471 r4472  
    100100}; 
    101101 
    102 const unsigned int MAX_NUM_EVENTS = 0; 
     102const unsigned int MAX_NUM_EVENTS = 10; 
    103103 
    104104class CameraPacket { 
     
    181181        _events[_numEvents].set(*event); 
    182182    } 
    183     std::cout<<"written events = "<<_numEvents<<std::endl; 
     183    osg::notify(osg::INFO)<<"written events = "<<_numEvents<<std::endl; 
    184184} 
    185185 
    186186void CameraPacket::writeEventQueue(osgProducer::Viewer& viewer) 
    187187{ 
    188     std::cout<<"recieved events = "<<_numEvents<<std::endl; 
     188    osg::notify(osg::INFO)<<"recieved events = "<<_numEvents<<std::endl; 
    189189 
    190190    // copy the packed events to osgProducer style events. 
     
    212212int main( int argc, char **argv ) 
    213213{ 
     214    osg::notify(osg::INFO)<<"FrameStamp "<<sizeof(osg::FrameStamp)<<std::endl; 
     215    osg::notify(osg::INFO)<<"osg::Matrix "<<sizeof(osg::Matrix)<<std::endl; 
     216    osg::notify(osg::INFO)<<"PackedEvent "<<sizeof(PackedEvent)<<std::endl; 
     217 
    214218 
    215219    // use an ArgumentParser object to manage the program arguments. 
     
    305309 
    306310    bc.setPort(static_cast<short int>(socketNumber)); 
    307     rc.setPort(static_cast<short int>(socketNumber+1)); 
     311    rc.setPort(static_cast<short int>(socketNumber)); 
    308312 
    309313    bool masterKilled = false; 
     
    342346                rc.setBuffer(cp, sizeof( CameraPacket )); 
    343347 
    344                 std::cout << "rc.sync()"<<sizeof( CameraPacket )<<std::endl; 
     348                osg::notify(osg::INFO) << "rc.sync()"<<sizeof( CameraPacket )<<std::endl; 
    345349 
    346350                rc.sync(); 
    347351     
    348                 std::cout << "done"<<std::endl; 
    349  
    350352                cp->checkByteOrder(); 
    351353 
    352                 // cp->writeEventQueue(viewer); 
     354                cp->writeEventQueue(viewer); 
    353355 
    354356                if (cp->getMasterKilled())  
    355357                { 
    356                     std::cout << "received master killed"<<std::endl; 
     358                    std::cout << "Received master killed."<<std::endl; 
    357359                    // break out of while (!done) loop since we've now want to shut down. 
    358360                    masterKilled = true; 
     
    367369        osg::Timer_t endTick = osg::Timer::instance()->tick(); 
    368370         
    369         osg::notify(osg::NOTICE)<<"Time to do sync "<<osg::Timer::instance()->delta_m(startTick,endTick)<<std::endl; 
     371        osg::notify(osg::INFO)<<"Time to do cluster sync "<<osg::Timer::instance()->delta_m(startTick,endTick)<<std::endl; 
    370372 
    371373        // update the scene by traversing it with the the update visitor which will 
     
    400402        bc.sync(); 
    401403 
    402         std::cout << "broadcasting death"<<std::endl; 
     404        std::cout << "Broadcasting death."<<std::endl; 
    403405 
    404406    }