Changeset 20121

Show
Ignore:
Timestamp:
05/03/07 06:42:45 (2 years ago)
Author:
patrick
Message:

MFT r20120: Improved stability in multi-pipe/multi-threaded configurations by

ensuring that osgUtil::SceneView::setSceneData() is invoked only
once per context and in a serialized fashion.

Submitted by: Doug McCorkle? < mccdo at iastate dot edu >

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/branches/2.2/modules/vrjuggler/vrj/Draw/OSG/OsgApp.h

    r19729 r20121  
    3535 
    3636#include <vrj/Display/CameraProjection.h> 
     37 
     38#include <vpr/Sync/Mutex.h> 
     39#include <vpr/Sync/Guard.h> 
    3740 
    3841#include <osg/Vec3> 
     
    273276   int mFrameNumber; 
    274277   gadget::PositionInterface mHead; 
     278   vpr::Mutex mSceneViewLock; 
    275279}; 
    276280 
     
    283287   this->configSceneView(new_sv.get());            // Configure the new viewer 
    284288   new_sv->getState()->setContextID(unique_context_id); 
     289   // Add the tree to the scene viewer and set properties 
     290   { 
     291      vpr::Guard<vpr::Mutex> sv_guard(mSceneViewLock); 
     292      new_sv->setSceneData(getScene()); 
     293   } 
    285294 
    286295   // This will eventually be changed to no light and all lighting will be handled 
     
    364373   unsigned y_size = unsigned(vp_sy*float(w_height)); 
    365374 
    366    // Add the tree to the scene viewer and set properties 
    367    sv->setSceneData(getScene()); 
    368375   //sv->setCalcNearFar(false); 
    369376   sv->setComputeNearFarMode(osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR);