Changeset 20120

Show
Ignore:
Timestamp:
05/03/07 06:41:24 (1 year ago)
Author:
patrick
Message:

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/trunk/modules/vrjuggler/vrj/Draw/OSG/OsgApp.h

    r20119 r20120  
    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> 
     
    361364   int mFrameNumber; 
    362365   gadget::PositionInterface mHead; 
     366   vpr::Mutex mSceneViewLock; 
    363367}; 
    364368 
     
    371375   this->configSceneView(new_sv.get());            // Configure the new viewer 
    372376   new_sv->getState()->setContextID(unique_context_id); 
     377   // Add the tree to the scene viewer and set properties 
     378   { 
     379      vpr::Guard<vpr::Mutex> sv_guard(mSceneViewLock); 
     380      new_sv->setSceneData(getScene()); 
     381   } 
    373382 
    374383   (*sceneViewer) = new_sv; 
     
    446455   unsigned y_size = unsigned(vp_sy*float(w_height)); 
    447456 
    448    // Add the tree to the scene viewer and set properties 
    449    sv->setSceneData(getScene()); 
    450457   //sv->setCalcNearFar(false); 
    451458   sv->setComputeNearFarMode(osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR);