Moved compile setup from osgViewer::ViewerBase into osgViewer::Renderer to
avoid threading issues associated with compile running in a parallel with update/cull on the first frame. Also added automatic recompile when a new SceneData is applied to a View.
This commit is contained in:
@@ -66,10 +66,16 @@ class OSGVIEWER_EXPORT Renderer : public osg::GraphicsOperation, public OpenGLQu
|
||||
void setGraphicsThreadDoesCull(bool flag);
|
||||
bool getGraphicsThreadDoesCull() const { return _graphicsThreadDoesCull; }
|
||||
|
||||
|
||||
virtual void cull();
|
||||
virtual void draw();
|
||||
virtual void cull_draw();
|
||||
|
||||
virtual void compile();
|
||||
|
||||
void setCompileOnNextDraw(bool flag) { _compileOnNextDraw = flag; }
|
||||
bool getCompileOnNextDraw() const { return _compileOnNextDraw; }
|
||||
|
||||
virtual void operator () (osg::Object* object);
|
||||
|
||||
virtual void operator () (osg::GraphicsContext* context);
|
||||
@@ -136,6 +142,7 @@ class OSGVIEWER_EXPORT Renderer : public osg::GraphicsOperation, public OpenGLQu
|
||||
|
||||
bool _done;
|
||||
bool _graphicsThreadDoesCull;
|
||||
bool _compileOnNextDraw;
|
||||
|
||||
osg::ref_ptr<osgUtil::SceneView> _sceneView[2];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user