OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
osg::Shader::PerContextShader Class Reference

#include <Shader.h>

Inheritance diagram for osg::Shader::PerContextShader:
Inheritance graph
[legend]
Collaboration diagram for osg::Shader::PerContextShader:
Collaboration graph
[legend]

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 &)
 
Referencedoperator= (const Referenced &)
 
virtual void setThreadSafeRefUnref (bool threadSafe)
 
bool getThreadSafeRefUnref () const
 
OpenThreads::MutexgetRefMutex () const
 
int ref () const
 
int unref () const
 
int unref_nodelete () const
 
int referenceCount () const
 
ObserverSetgetObserverSet () const
 
ObserverSetgetOrCreateObserverSet () 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::MutexgetGlobalReferencedMutex ()
 
static void setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting)
 
static bool getThreadSafeReferenceCounting ()
 
static void setDeleteHandler (DeleteHandler *handler)
 
static DeleteHandlergetDeleteHandler ()
 

Detailed Description

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

Definition at line 227 of file Shader.h.

Constructor & Destructor Documentation

osg::Shader::PerContextShader::PerContextShader ( const Shader shader,
unsigned int  contextID 
)
osg::Shader::PerContextShader::~PerContextShader ( )
protected

Member Function Documentation

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

Attach our glShader to a glProgram

void osg::Shader::PerContextShader::compileShader ( osg::State state)
void osg::Shader::PerContextShader::detachShader ( GLuint  program) const

Detach our glShader from a glProgram

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

Definition at line 233 of file Shader.h.

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

Definition at line 235 of file Shader.h.

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

Definition at line 240 of file Shader.h.

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

Definition at line 239 of file Shader.h.

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

Definition at line 232 of file Shader.h.

Member Data Documentation

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

Definition at line 271 of file Shader.h.

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

Define string passed on to Shaders to help configure them.

Definition at line 263 of file Shader.h.

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

Pointer to this context's extension functions.

Definition at line 257 of file Shader.h.

GLuint osg::Shader::PerContextShader::_glShaderHandle
protected

Handle to the actual glShader.

Definition at line 260 of file Shader.h.

bool osg::Shader::PerContextShader::_isCompiled
protected

Is our glShader successfully compiled?

Definition at line 269 of file Shader.h.

bool osg::Shader::PerContextShader::_needsCompile
protected

Does our glShader need to be recompiled?

Definition at line 266 of file Shader.h.

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

Pointer to our parent osg::Shader

Definition at line 254 of file Shader.h.


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