osg::Shader::PerContextShader Class Reference

`#include <Shader>`

Inheritance diagram for osg::Shader::PerContextShader:

## Public Member Functions

| PerContextShader (const Shader *shader, unsigned int contextID)
void | setDefineString (const std::string &defStr)
const std::string & | getDefineString () const
GLuint | getHandle () const
void | requestCompile ()
void | compileShader (osg::State &state)
bool | needsCompile () const
bool | isCompiled () const
bool | getInfoLog (std::string &infoLog) const
void | attachShader (GLuint program) const
void | detachShader (GLuint program) const
Public Member Functions inherited from osg::Referenced
| Referenced ()
| Referenced (bool threadSafeRefUnref)
| Referenced (const Referenced &)
Referenced & | operator= (const Referenced &)
virtual void | setThreadSafeRefUnref (bool)
bool | getThreadSafeRefUnref () const
OpenThreads::Mutex * | getRefMutex () const
int | ref () const
int | unref () const
int | unref_nodelete () const
int | referenceCount () const
ObserverSet * | getObserverSet () const
ObserverSet * | getOrCreateObserverSet () const
void | addObserver (Observer *observer) const
void | removeObserver (Observer *observer) const

## Protected Member Functions

| ~PerContextShader ()
Protected Member Functions inherited from osg::Referenced
virtual | ~Referenced ()
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const
void | deleteUsingDeleteHandler () const

## Protected Attributes

const Shader * | _shader
osg::ref_ptr< osg::GLExtensions > | _extensions
GLuint | _glShaderHandle
std::string | _defineStr
bool | _needsCompile
bool | _isCompiled
const unsigned int | _contextID
Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr | _observerSet
OpenThreads::Atomic | _refCount

## Additional Inherited Members

Static Public Member Functions inherited from osg::Referenced
static OpenThreads::Mutex * | getGlobalReferencedMutex ()
static void | setDeleteHandler (DeleteHandler *handler)
static DeleteHandler * | getDeleteHandler ()

## Detailed Description

PerContextShader (PCS) is an OSG-internal encapsulation of glShader per-GL context.

## Constructor & Destructor Documentation

## PerContextShader()

osg::Shader::PerContextShader::PerContextShader | ( | const Shader * | shader,
|  | unsigned int | contextID )

References osg::Shader::Shader().

## ~PerContextShader()

osg::Shader::PerContextShader::~PerContextShader | ( |  | ) |

protected

## Member Function Documentation

## attachShader()

void osg::Shader::PerContextShader::attachShader | ( | GLuint | program | ) | const

Attach our glShader to a glProgram

## compileShader()

void osg::Shader::PerContextShader::compileShader | ( | osg::State & | state | ) |

## detachShader()

void osg::Shader::PerContextShader::detachShader | ( | GLuint | program | ) | const

Detach our glShader from a glProgram

## getDefineString()

const std::string & osg::Shader::PerContextShader::getDefineString | ( |  | ) | const

inline

References _defineStr.

## getHandle()

GLuint osg::Shader::PerContextShader::getHandle | ( |  | ) | const

inline

References _glShaderHandle.

## getInfoLog()

bool osg::Shader::PerContextShader::getInfoLog | ( | std::string & | infoLog | ) | const

## isCompiled()

bool osg::Shader::PerContextShader::isCompiled | ( |  | ) | const

inline

References _isCompiled.

## needsCompile()

bool osg::Shader::PerContextShader::needsCompile | ( |  | ) | const

inline

References _needsCompile.

## requestCompile()

void osg::Shader::PerContextShader::requestCompile | ( |  | ) |

## setDefineString()

void osg::Shader::PerContextShader::setDefineString | ( | const std::string & | defStr | ) |

inline

References _defineStr.

## Member Data Documentation

## _contextID

const unsigned int osg::Shader::PerContextShader::_contextID

protected

## _defineStr

std::string osg::Shader::PerContextShader::_defineStr

protected

Define string passed on to Shaders to help configure them.

Referenced by getDefineString(), and setDefineString().

## _extensions

osg::ref_ptr<osg::GLExtensions> osg::Shader::PerContextShader::_extensions

protected

Pointer to this context's extension functions.

## _glShaderHandle

GLuint osg::Shader::PerContextShader::_glShaderHandle

protected

Handle to the actual glShader.

Referenced by getHandle().

## _isCompiled

bool osg::Shader::PerContextShader::_isCompiled

protected

Is our glShader successfully compiled?

Referenced by isCompiled().

## _needsCompile

bool osg::Shader::PerContextShader::_needsCompile

protected

Does our glShader need to be recompiled?

Referenced by needsCompile().

## _shader

const Shader* osg::Shader::PerContextShader::_shader

protected

Pointer to our parent osg::Shader

The documentation for this class was generated from the following file:

- Shader