diff --git a/include/osg/State b/include/osg/State index 79a6563bc..097a5a4d6 100644 --- a/include/osg/State +++ b/include/osg/State @@ -806,6 +806,12 @@ class OSG_EXPORT State : public Referenced inline const DisplaySettings* getDisplaySettings() const { return _displaySettings.get(); } + /** Set the root StateSet this is applied above all StateSet that are pushed and popped during the draw traversal.*/ + void setRootStateSet(osg::StateSet* stateset); + + /** Get the root StateSet.*/ + osg::StateSet* getRootStateSet() { return _rootStateSet.get(); } + /** Set flag for early termination of the draw traversal.*/ void setAbortRenderingPtr(bool* abortPtr) { _abortRenderingPtr = abortPtr; } @@ -1047,6 +1053,8 @@ class OSG_EXPORT State : public Referenced GraphicsContext* _graphicsContext; unsigned int _contextID; + osg::ref_ptr _rootStateSet; + osg::ref_ptr _globalVertexArrayState; VertexArrayState* _vas; diff --git a/src/osg/State.cpp b/src/osg/State.cpp index bc6e98069..95fb0b45f 100644 --- a/src/osg/State.cpp +++ b/src/osg/State.cpp @@ -507,9 +507,36 @@ void State::setMaxBufferObjectPoolSize(unsigned int size) OSG_INFO<<"osg::State::_maxBufferObjectPoolSize="<<_maxBufferObjectPoolSize<