Implemented perliminary multi-threading support in osgViewer::Viewer
This commit is contained in:
@@ -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;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user