Implemented perliminary multi-threading support in osgViewer::Viewer

This commit is contained in:
Robert Osfield
2006-12-22 17:46:21 +00:00
parent b4ec8a8275
commit bd6b7d581e
9 changed files with 315 additions and 539 deletions

View File

@@ -18,6 +18,8 @@
#include <osgGA/MatrixManipulator>
#include <osgViewer/Scene>
#include <osgUtil/SceneView>
namespace osgViewer {
/** View holds a single view on a scene, this view may be composed of one or more slave cameras.*/
@@ -64,6 +66,9 @@ class OSGVIEWER_EXPORT View : public osg::View
osg::ref_ptr<osgGA::MatrixManipulator> _cameraManipulator;
EventHandlers _eventHandlers;
typedef std::map<osg::ref_ptr<osg::Camera>, osg::ref_ptr<osgUtil::SceneView> > CameraSceneViewMap;
CameraSceneViewMap _cameraSceneViewMap;
};
}

View File

@@ -53,16 +53,20 @@ class OSGVIEWER_EXPORT Viewer : public osgViewer::View
/** Clean up all OpenGL objects associated with this viewer's scenegraph.*/
virtual void cleanup();
public:
void init();
typedef std::vector<osg::GraphicsContext*> Contexts;
void getContexts(Contexts& contexts);
bool _firstFrame;
bool _done;
protected:
osg::ref_ptr<osg::BarrierOperation> _startRenderingBarrier;
osg::ref_ptr<osg::BarrierOperation> _endRenderingDispatchBarrier;
};