Added State::releaseGLObjects() and ShaderComposer::releaseGLObjects() to avoid problems with cleanup of graphics context
This commit is contained in:
@@ -35,11 +35,12 @@ class OSG_EXPORT ShaderComposer : public osg::Object
|
||||
|
||||
virtual osg::Program* getOrCreateProgram(const ShaderComponents& shaderComponents);
|
||||
|
||||
|
||||
typedef std::vector< const osg::Shader* > Shaders;
|
||||
virtual osg::Shader* composeMain(const Shaders& shaders);
|
||||
virtual void addShaderToProgram(Program* program, const Shaders& shaders);
|
||||
|
||||
void releaseGLObjects(osg::State* state);
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~ShaderComposer();
|
||||
|
||||
@@ -218,6 +218,9 @@ class OSG_EXPORT State : public Referenced, public Observer
|
||||
/** Copy the modes and attributes which capture the current state.*/
|
||||
void captureCurrentState(StateSet& stateset) const;
|
||||
|
||||
/** Release all OpenGL objects associated cached by this osg::State object.*/
|
||||
void releaseGLObjects();
|
||||
|
||||
/** reset the state object to an empty stack.*/
|
||||
void reset();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user