Added compile/release and resize of GL objects to ShaderAttribute.

Removed the StateAttribute::compose() method.

Fixed the default type value in ShaderAttribute
This commit is contained in:
Robert Osfield
2010-07-06 12:19:26 +00:00
parent 74ae526bb5
commit 46b221a832
7 changed files with 76 additions and 16 deletions

View File

@@ -291,6 +291,10 @@ class OSG_EXPORT ShaderComponent : public osg::Object
unsigned int getNumShaders() const { return _shaders.size(); }
virtual void compileGLObjects(State& state) const;
virtual void resizeGLObjectBuffers(unsigned int maxSize);
virtual void releaseGLObjects(State* state=0) const;
protected:
typedef std::vector< osg::ref_ptr<osg::Shader> > Shaders;

View File

@@ -54,8 +54,6 @@ class OSG_EXPORT ShaderAttribute : public StateAttribute
virtual void apply(State& state) const;
virtual void compose(ShaderComposer& composer) const;
virtual void compileGLObjects(State& state) const;
virtual void resizeGLObjectBuffers(unsigned int maxSize);

View File

@@ -322,9 +322,6 @@ class OSG_EXPORT StateAttribute : public Object
*/
virtual void apply(State&) const {}
/* compose associated shaders via the ShaderComposer. */
virtual void compose(ShaderComposer& composer) const {}
/** Default to nothing to compile - all state is applied immediately. */
virtual void compileGLObjects(State&) const {}