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:
Robert Osfield
2008-05-10 17:04:02 +00:00
parent 0dfba5dbe5
commit 4d7b2edd4c
4 changed files with 43 additions and 7 deletions

View File

@@ -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];