Added basic code injection fields to osg::Shader,

creation of main shader to ShaderComposer and
collection of ShaderComponent to osg::State.
Also added very basic shader set up in osgshadecomposition example.
This commit is contained in:
Robert Osfield
2010-07-05 16:32:58 +00:00
parent 9f8670f50d
commit 751b0498fe
7 changed files with 194 additions and 56 deletions

View File

@@ -142,6 +142,12 @@ class OSG_EXPORT State : public Referenced, public Observer
inline unsigned int getContextID() const { return _contextID; }
/* Set whether shader composition is enabled.*/
void setShaderCompositionEnabled(bool flag) { _shaderCompositionEnabled = flag; }
/* Get whether shader composition is enabled.*/
bool getShaderCompositionEnabled() const { return _shaderCompositionEnabled; }
/** Set the ShaderComposor object that implements shader composition.*/
void setShaderComposer(ShaderComposer* sc) { _shaderComposer = sc; }
@@ -250,6 +256,8 @@ class OSG_EXPORT State : public Referenced, public Observer
*/
void apply();
/** Apply any shader composed state.*/
void applyShaderComposition();
/** Set whether a particular OpenGL mode is valid in the current graphics context.
* Use to disable OpenGL modes that are not supported by current graphics drivers/context.*/