|
Public Member Functions |
| ProgramObject () |
| ProgramObject (const ProgramObject &rhs, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) |
| Copy constructor using CopyOp to manage deep vs shallow copy.
|
| META_StateAttribute (osgGL2, ProgramObject, PROGRAMOBJECT) |
virtual int | compare (const osg::StateAttribute &sa) const |
| return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
|
virtual void | apply (osg::State &state) const |
| If enabled, install our shader program in the GL pipeline, performing any shader program rebuild operations that might be pending.
|
virtual void | compileGLObjects (osg::State &state) const |
virtual void | releaseGLObjects (osg::State *state=0) const |
| release an OpenGL objects in specified graphics context if State object is passed, otherwise release OpenGL objexts for all graphics context if State object pointer NULL.
|
void | dirtyProgramObject () |
| Mark us as "dirty" and in need of relinking.
|
void | dirtyShaderObjects () |
| Mark our attached ShaderObjects as "dirty" and in need of recompilation.
|
void | enable (bool enabled) |
| An override to control whether the shader program will actually be installed when OSG attempts to apply().
|
void | addShader (ShaderObject *shadObj) |
| Attach a ShaderObject to this ProgramObject.
|
void | setUniform (const char *uniformName, int value) |
| Assign a value to a ProgramObject's uniform variable.
|
void | setUniform (const char *uniformName, float value) |
void | setUniform (const char *uniformName, osg::Vec2 value) |
void | setUniform (const char *uniformName, osg::Vec3 value) |
void | setUniform (const char *uniformName, osg::Vec4 value) |
void | setSampler (const char *uniformName, int value) |
Static Public Member Functions |
static void | deleteObject (unsigned int contextID, GLhandleARB handle) |
| Mark internal GL objects for deletion.
|
static void | flushDeletedGL2Objects (unsigned int contextID, double currentTime, double &availableTime) |
| flush all the cached glProgramObjects which need to be deleted in the OpenGL context related to contextID.
|
Protected Types |
typedef std::vector< ShaderObjectPtr > | ShaderObjectList |
Protected Member Functions |
virtual | ~ProgramObject () |
PerContextProgObj * | getPCPO (unsigned int contextID) const |
| Get the PCPO for a particular GL context.
|
void | updateUniforms (int frameNumber) const |
| Per frame, copy the list of pending UniformValue updates to each of the PCPOs.
|
Protected Attributes |
bool | _enabled |
ShaderObjectList | _shaderObjectList |
osg::buffered_value< osg::ref_ptr<
PerContextProgObj > > | _pcpoList |
int | _frameNumberOfLastPCPOUpdate |
UniformValueList | _univalList |
Classes |
class | PerContextProgObj |
| PCPO is an OSG-internal encapsulation of glProgramObjects per-GL context. More...
|