Changeset 1910

Show
Ignore:
Timestamp:
04/23/03 11:59:08 (12 years ago)
Author:
robert
Message:

Added check for camera's sharing the same RenderSurface?, if so switches off
multi-threading of cull and draw.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgProducer/OsgCameraGroup.cpp

    r1898 r1910  
    380380            _thread_model = Producer::CameraGroup::SingleThreaded; 
    381381        } 
     382        else 
     383        { 
     384            std::set<RenderSurface*> renderSurfaceSet; 
     385            for( unsigned int i = 0; i < _cfg->getNumberOfCameras(); i++ ) 
     386            { 
     387                Producer::Camera *cam = _cfg->getCamera(i); 
     388                renderSurfaceSet.insert(cam->getRenderSurface()); 
     389            } 
     390            if (renderSurfaceSet.size()!=_cfg->getNumberOfCameras()) 
     391            { 
     392                // camera's must be sharing a RenderSurface, so we need to ensure that we're 
     393                // running single threaded, to avoid OpenGL threading issues. 
     394                osg::notify(osg::INFO)<<"Warning: disabling multi-threading of cull and draw to avoid"<<std::endl; 
     395                osg::notify(osg::INFO)<<"         threading problems when camera's share a RenderSurface."<<std::endl; 
     396                _thread_model = Producer::CameraGroup::SingleThreaded; 
     397            } 
     398             
     399             
     400        } 
     401         
    382402    } 
    383403