Changeset 20122

Show
Ignore:
Timestamp:
05/03/07 06:44:19 (1 year 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.0/modules/vrjuggler/vrj/Draw/OSG/OsgApp.h

    r19509 r20122  
    4141 
    4242#include <vrj/Display/CameraProjection.h> 
     43 
     44#include <vpr/Sync/Mutex.h> 
     45#include <vpr/Sync/Guard.h> 
    4346 
    4447#include <osg/Vec3> 
     
    279282   int mFrameNumber; 
    280283   gadget::PositionInterface mHead; 
     284   vpr::Mutex mSceneViewLock; 
    281285}; 
    282286 
     
    289293   this->configSceneView(new_sv.get());            // Configure the new viewer 
    290294   new_sv->getState()->setContextID(unique_context_id); 
     295   // Add the tree to the scene viewer and set properties 
     296   { 
     297      vpr::Guard<vpr::Mutex> sv_guard(mSceneViewLock); 
     298      new_sv->setSceneData(getScene()); 
     299   } 
    291300 
    292301   // This will eventually be changed to no light and all lighting will be handled 
     
    374383   unsigned y_size = unsigned(vp_sy*float(w_height)); 
    375384 
    376    // Add the tree to the scene viewer and set properties 
    377    sv->setSceneData(getScene()); 
    378385   //sv->setCalcNearFar(false); 
    379386   sv->setComputeNearFarMode(osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR);