class OSGGL2_EXPORT osgGL2::ShaderObject

osgGL2::ShaderObject is an application-level abstraction of the OpenGL Shading Language glShaderObject.

Inheritance:


Public Classes

[more]enum Type

Public Methods

[more] ShaderObject()
[more] ShaderObject(Type type)
[more] ShaderObject(Type type, const char* sourceText)
[more] ShaderObject(const ShaderObject& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy
[more] META_Object(osgGL2, ShaderObject)
[more]int compare(const ShaderObject& sa) const
[more]void setShaderSource( const char* sourceText )
Load the ShaderObject's source code text from a string.
[more]inline const std::string& getShaderSource() const
Retreive the source code text
[more]bool loadShaderSourceFromFile( const char* fileName )
Load the ShaderObject's source code text from a file.
[more]inline Type getType() const
Get the ShaderObject type as an enum.
[more]const char* getTypename() const
Get the ShaderObject type as a descriptive string.
[more]void dirtyShaderObject()
Mark us as "dirty" and in need of recompilation
[more]void build(unsigned int contextID) const
Perform a recompilation of all our PCSOs
[more]void attach(unsigned int contextID, GLhandleARB progObj) const
For a given GL context, attach a glShaderObject to a glProgramObject

Protected Classes

class PerContextShaderObj: public osg::Referenced
PCSO is an OSG-internal encapsulation of glShaderObjects per-GL context.

Protected Fields

[more]Type _type
[more]std::string _shaderSource
[more]std::vector< ProgramObjectPtr > _programObjectList
[more]mutable osg::buffered_value< osg::ref_ptr<PerContextShaderObj> > _pcsoList

Protected Methods

[more]virtual ~ShaderObject()
[more]PerContextShaderObj* getPCSO(unsigned int contextID) const
[more]void addProgObjRef( ProgramObject* progObj )


Documentation

osgGL2::ShaderObject is an application-level abstraction of the OpenGL Shading Language glShaderObject. It is a container to load the shader source code text and manage its compilation. A ShaderObject may be attached to more than one osgGL2::ProgramObject. ShaderObject will automatically manage per-context instancing of the internal objects, if that is necessary for a particular display configuration.
oenum Type

o VERTEX

o FRAGMENT

o UNKNOWN

o ShaderObject()

o ShaderObject(Type type)

o ShaderObject(Type type, const char* sourceText)

o ShaderObject(const ShaderObject& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy

o META_Object(osgGL2, ShaderObject)

oint compare(const ShaderObject& sa) const

ovoid setShaderSource( const char* sourceText )
Load the ShaderObject's source code text from a string.

oinline const std::string& getShaderSource() const
Retreive the source code text

obool loadShaderSourceFromFile( const char* fileName )
Load the ShaderObject's source code text from a file.

oinline Type getType() const
Get the ShaderObject type as an enum.

oconst char* getTypename() const
Get the ShaderObject type as a descriptive string.

ovoid dirtyShaderObject()
Mark us as "dirty" and in need of recompilation

ovoid build(unsigned int contextID) const
Perform a recompilation of all our PCSOs

ovoid attach(unsigned int contextID, GLhandleARB progObj) const
For a given GL context, attach a glShaderObject to a glProgramObject

ovirtual ~ShaderObject()

oPerContextShaderObj* getPCSO(unsigned int contextID) const

ovoid addProgObjRef( ProgramObject* progObj )

oType _type

ostd::string _shaderSource

ostd::vector< ProgramObjectPtr > _programObjectList

omutable osg::buffered_value< osg::ref_ptr<PerContextShaderObj> > _pcsoList


This class has no child classes.
Friends:
void ProgramObject::addShader( ShaderObject* shadObj )

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.