osg::State Class Reference

`#include <State>`

Inheritance diagram for osg::State:

## Classes

struct | ApplyModeProxy
struct | ApplyTextureModeProxy
struct | SetCurrentVertexArrayStateProxy
struct | DynamicObjectRenderingCompletedCallback
struct | ModeStack
struct | AttributeStack
struct | UniformStack
struct | DefineStack
struct | DefineMap

## Public Types

enum | CheckForGLErrors { NEVER_CHECK_GL_ERRORS , ONCE_PER_FRAME , ONCE_PER_ATTRIBUTE }
typedef std::map< const std::type_info *, osg::ref_ptr< osg::Referenced > > | ExtensionMap
typedef std::vector< const StateSet * > | StateSetStack
typedef std::vector< VertexAttribAlias > | VertexAttribAliasList
typedef std::vector< GLushort > | IndicesGLushort
typedef std::vector< GLuint > | IndicesGLuint
typedef std::pair< const StateAttribute *, StateAttribute::OverrideValue > | AttributePair
typedef std::vector< AttributePair > | AttributeVec
typedef std::map< StateAttribute::GLMode, ModeStack > | ModeMap
typedef std::vector< ModeMap > | TextureModeMapList
typedef std::map< StateAttribute::TypeMemberPair, AttributeStack > | AttributeMap
typedef std::vector< AttributeMap > | TextureAttributeMapList
typedef std::map< std::string, UniformStack > | UniformMap
typedef std::vector< ref_ptr< const Matrix > > | MatrixStack

## Public Member Functions

| State ()
void | setGraphicsContext (GraphicsContext *context)
GraphicsContext * | getGraphicsContext ()
const GraphicsContext * | getGraphicsContext () const
void | setContextID (unsigned int contextID)
unsigned int | getContextID () const
template<typename T>
T * | get ()
template<typename T>
const T * | get () const
template<typename T>
void | set (T *ptr)
void | setShaderCompositionEnabled (bool flag)
bool | getShaderCompositionEnabled () const
void | setShaderComposer (ShaderComposer *sc)
ShaderComposer * | getShaderComposer ()
const ShaderComposer * | getShaderComposer () const
StateSet::UniformList & | getCurrentShaderCompositionUniformList ()
void | applyShaderCompositionUniform (const osg::Uniform *uniform, StateAttribute::OverrideValue value=StateAttribute::ON)
void | pushStateSet (const StateSet *dstate)
void | popStateSet ()
void | popAllStateSets ()
void | insertStateSet (unsigned int pos, const StateSet *dstate)
void | removeStateSet (unsigned int pos)
unsigned int | getStateSetStackSize ()
void | popStateSetStackToSize (unsigned int size)
StateSetStack & | getStateSetStack ()
void | captureCurrentState (StateSet &stateset) const
void | releaseGLObjects ()
void | reset ()
const Viewport * | getCurrentViewport () const
void | setInitialViewMatrix (const osg::RefMatrix *matrix)
const osg::Matrix & | getInitialViewMatrix () const
const osg::Matrix & | getInitialInverseViewMatrix () const
void | applyProjectionMatrix (const osg::RefMatrix *matrix)
const osg::Matrix & | getProjectionMatrix () const
void | applyModelViewMatrix (const osg::RefMatrix *matrix)
void | applyModelViewMatrix (const osg::Matrix &)
const osg::Matrix & | getModelViewMatrix () const
void | setUseModelViewAndProjectionUniforms (bool flag)
bool | getUseModelViewAndProjectionUniforms () const
void | updateModelViewAndProjectionMatrixUniforms ()
void | applyModelViewAndProjectionUniformsIfRequired ()
osg::Uniform * | getModelViewMatrixUniform ()
osg::Uniform * | getProjectionMatrixUniform ()
osg::Uniform * | getModelViewProjectionMatrixUniform ()
osg::Uniform * | getNormalMatrixUniform ()
Polytope | getViewFrustum () const
void | setUseVertexAttributeAliasing (bool flag)
bool | getUseVertexAttributeAliasing () const
void | resetVertexAttributeAlias (bool compactAliasing=true, unsigned int numTextureUnits=8)
void | setVertexAlias (const VertexAttribAlias &alias)
const VertexAttribAlias & | getVertexAlias ()
void | setNormalAlias (const VertexAttribAlias &alias)
const VertexAttribAlias & | getNormalAlias ()
void | setColorAlias (const VertexAttribAlias &alias)
const VertexAttribAlias & | getColorAlias ()
void | setSecondaryColorAlias (const VertexAttribAlias &alias)
const VertexAttribAlias & | getSecondaryColorAlias ()
void | setFogCoordAlias (const VertexAttribAlias &alias)
const VertexAttribAlias & | getFogCoordAlias ()
void | setTexCoordAliasList (const VertexAttribAliasList &aliasList)
const VertexAttribAliasList & | getTexCoordAliasList ()
void | setAttributeBindingList (const Program::AttribBindingList &attribBindingList)
const Program::AttribBindingList & | getAttributeBindingList ()
bool | convertVertexShaderSourceToOsgBuiltIns (std::string &source) const
void | apply (const StateSet *dstate)
void | apply ()
void | applyShaderComposition ()
void | glDrawBuffer (GLenum buffer)
GLenum | getDrawBuffer () const
void | glReadBuffer (GLenum buffer)
GLenum | getReadBuffer () const
void | setModeValidity (StateAttribute::GLMode mode, bool valid)
bool | getModeValidity (StateAttribute::GLMode mode)
void | setGlobalDefaultModeValue (StateAttribute::GLMode mode, bool enabled)
bool | getGlobalDefaultModeValue (StateAttribute::GLMode mode)
bool | getLastAppliedModeValue (StateAttribute::GLMode mode)
bool | applyMode (StateAttribute::GLMode mode, bool enabled)
void | setGlobalDefaultTextureModeValue (unsigned int unit, StateAttribute::GLMode mode, bool enabled)
bool | getGlobalDefaultTextureModeValue (unsigned int unit, StateAttribute::GLMode mode)
bool | applyTextureMode (unsigned int unit, StateAttribute::GLMode mode, bool enabled)
bool | getLastAppliedTextureModeValue (unsigned int unit, StateAttribute::GLMode mode)
void | setGlobalDefaultAttribute (const StateAttribute *attribute)
const StateAttribute * | getGlobalDefaultAttribute (StateAttribute::Type type, unsigned int member=0)
bool | applyAttribute (const StateAttribute *attribute)
void | setGlobalDefaultTextureAttribute (unsigned int unit, const StateAttribute *attribute)
const StateAttribute * | getGlobalDefaultTextureAttribute (unsigned int unit, StateAttribute::Type type, unsigned int member=0)
bool | applyTextureAttribute (unsigned int unit, const StateAttribute *attribute)
void | haveAppliedMode (StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
void | haveAppliedMode (StateAttribute::GLMode mode)
void | haveAppliedAttribute (const StateAttribute *attribute)
void | haveAppliedAttribute (StateAttribute::Type type, unsigned int member=0)
bool | getLastAppliedMode (StateAttribute::GLMode mode) const
const StateAttribute * | getLastAppliedAttribute (StateAttribute::Type type, unsigned int member=0) const
void | haveAppliedTextureMode (unsigned int unit, StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
void | haveAppliedTextureMode (unsigned int unit, StateAttribute::GLMode mode)
void | haveAppliedTextureAttribute (unsigned int unit, const StateAttribute *attribute)
void | haveAppliedTextureAttribute (unsigned int unit, StateAttribute::Type type, unsigned int member=0)
bool | getLastAppliedTextureMode (unsigned int unit, StateAttribute::GLMode mode) const
const StateAttribute * | getLastAppliedTextureAttribute (unsigned int unit, StateAttribute::Type type, unsigned int member=0) const
void | dirtyAllModes ()
void | dirtyAllAttributes ()
void | setCurrentVertexArrayState (VertexArrayState *vas)
VertexArrayState * | getCurrentVertexArrayState () const
void | setCurrentToGlobalVertexArrayState ()
void | resetCurrentVertexArrayStateOnMatch (VertexArrayState *vas)
void | disableAllVertexArrays ()
void | lazyDisablingOfVertexAttributes ()
void | applyDisablingOfVertexAttributes ()
void | setCurrentVertexBufferObject (osg::GLBufferObject *vbo)
const GLBufferObject * | getCurrentVertexBufferObject ()
void | bindVertexBufferObject (osg::GLBufferObject *vbo)
void | unbindVertexBufferObject ()
void | setCurrentElementBufferObject (osg::GLBufferObject *ebo)
const GLBufferObject * | getCurrentElementBufferObject ()
void | bindElementBufferObject (osg::GLBufferObject *ebo)
void | unbindElementBufferObject ()
void | setCurrentPixelBufferObject (osg::GLBufferObject *pbo)
const GLBufferObject * | getCurrentPixelBufferObject () const
void | bindPixelBufferObject (osg::GLBufferObject *pbo)
void | unbindPixelBufferObject ()
void | bindDrawIndirectBufferObject (osg::GLBufferObject *ibo)
void | unbindDrawIndirectBufferObject ()
void | setCurrentVertexArrayObject (GLuint vao)
GLuint | getCurrentVertexArrayObject () const
void | bindVertexArrayObject (const VertexArrayState *vas)
void | bindVertexArrayObject (GLuint vao)
void | unbindVertexArrayObject ()
void | drawQuads (GLint first, GLsizei count, GLsizei primCount=0)
void | glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei primcount)
void | glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)
void | Vertex (float x, float y, float z, float w=1.0f)
void | Color (float r, float g, float b, float a=1.0f)
void | Normal (float x, float y, float z)
void | TexCoord (float x, float y=0.0f, float z=0.0f, float w=1.0f)
void | MultiTexCoord (unsigned int unit, float x, float y=0.0f, float z=0.0f, float w=1.0f)
void | VerteAttrib (unsigned int location, float x, float y=0.0f, float z=0.0f, float w=0.0f)
void | setInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer)
void | setVertexPointer (const Array *array)
void | setVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE)
void | disableVertexPointer ()
void | setNormalPointer (const Array *array)
void | setNormalPointer (GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE)
void | disableNormalPointer ()
void | setColorPointer (const Array *array)
void | setColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_TRUE)
void | disableColorPointer ()
bool | isSecondaryColorSupported () const
void | setSecondaryColorPointer (const Array *array)
void | disableSecondaryColorPointer ()
bool | isFogCoordSupported () const
void | setFogCoordPointer (const Array *array)
void | disableFogCoordPointer ()
void | setTexCoordPointer (unsigned int unit, const Array *array)
void | setTexCoordPointer (unsigned int unit, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE)
void | disableTexCoordPointer (unsigned int unit)
void | disableTexCoordPointersAboveAndIncluding (unsigned int unit)
GLint | getMaxTextureCoords () const
| For GL>=2.0 uses GL_MAX_TEXTURE_COORDS, for GL<2 uses GL_MAX_TEXTURE_UNITS.
GLint | getMaxTextureUnits () const
| For GL>=2.0 uses GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, for GL<2 uses GL_MAX_TEXTURE_UNITS.
bool | setActiveTextureUnit (unsigned int unit)
unsigned int | getActiveTextureUnit () const
bool | setClientActiveTextureUnit (unsigned int unit)
unsigned int | getClientActiveTextureUnit () const
void | setVertexAttribPointer (unsigned int unit, const Array *array)
void | setVertexAttribLPointer (unsigned int unit, const Array *array)
void | setVertexAttribIPointer (unsigned int unit, const Array *array)
void | disableVertexAttribPointer (unsigned int index)
void | disableVertexAttribPointersAboveAndIncluding (unsigned int index)
void | dirtyAllVertexArrays ()
bool | isVertexBufferObjectSupported () const
bool | useVertexBufferObject (bool useVBO) const
bool | isVertexArrayObjectSupported () const
bool | useVertexArrayObject (bool useVAO) const
void | setLastAppliedProgramObject (const Program::PerContextProgram *program)
const Program::PerContextProgram * | getLastAppliedProgramObject () const
GLint | getUniformLocation (unsigned int uniformNameID) const
GLint | getUniformLocation (const std::string &uniformName) const
GLint | getAttribLocation (const std::string &name) const
AttributeVec & | getAttributeVec (const osg::StateAttribute *attribute)
void | setFrameStamp (FrameStamp *fs)
FrameStamp * | getFrameStamp ()
const FrameStamp * | getFrameStamp () const
void | setDisplaySettings (DisplaySettings *vs)
const DisplaySettings * | getDisplaySettings () const
DisplaySettings * | getActiveDisplaySettings ()
const DisplaySettings * | getActiveDisplaySettings () const
void | setAbortRenderingPtr (bool *abortPtr)
bool | getAbortRendering () const
void | setDynamicObjectRenderingCompletedCallback (DynamicObjectRenderingCompletedCallback *cb)
DynamicObjectRenderingCompletedCallback * | getDynamicObjectRenderingCompletedCallback ()
void | setDynamicObjectCount (unsigned int count, bool callCallbackOnZero=false)
unsigned int | getDynamicObjectCount () const
void | decrementDynamicObjectCount ()
void | setMaxTexturePoolSize (unsigned int size)
unsigned int | getMaxTexturePoolSize () const
void | setMaxBufferObjectPoolSize (unsigned int size)
unsigned int | getMaxBufferObjectPoolSize () const
void | setCheckForGLErrors (CheckForGLErrors check)
CheckForGLErrors | getCheckForGLErrors () const
bool | checkGLErrors (const char *str1=0, const char *str2=0) const
bool | checkGLErrors (StateAttribute::GLMode mode) const
bool | checkGLErrors (const StateAttribute *attribute) const
void | print (std::ostream &fout) const
void | initializeExtensionProcs ()
AttributeDispatchers & | getAttributeDispatchers ()
void | setGraphicsCostEstimator (GraphicsCostEstimator *gce)
GraphicsCostEstimator * | getGraphicsCostEstimator ()
const GraphicsCostEstimator * | getGraphicsCostEstimator () const
Timer_t | getStartTick () const
void | setStartTick (Timer_t tick)
Timer_t | getGpuTick () const
double | getGpuTime () const
GLuint64 | getGpuTimestamp () const
void | setGpuTimestamp (Timer_t tick, GLuint64 timestamp)
int | getTimestampBits () const
void | setTimestampBits (int bits)
virtual void | frameCompleted ()
const ModeMap & | getModeMap () const
const AttributeMap & | getAttributeMap () const
const UniformMap & | getUniformMap () const
DefineMap & | getDefineMap ()
const DefineMap & | getDefineMap () const
const TextureModeMapList & | getTextureModeMapList () const
const TextureAttributeMapList & | getTextureAttributeMapList () const
std::string | getDefineString (const osg::ShaderDefines &shaderDefines)
bool | supportsShaderRequirements (const osg::ShaderDefines &shaderRequirements)
bool | supportsShaderRequirement (const std::string &shaderRequirement)
template<>
GLExtensions * | get ()
template<>
const GLExtensions * | get () const
template<>
void | set (GLExtensions *ptr)
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

## Public Attributes

ExtensionMap | _extensionMap
IndicesGLushort | _quadIndicesGLushort [4]
IndicesGLuint | _quadIndicesGLuint [4]

## Protected Types

typedef void(GL_APIENTRY * | ActiveTextureProc) (GLenum texture)
typedef void(GL_APIENTRY * | FogCoordPointerProc) (GLenum type, GLsizei stride, const GLvoid *pointer)
typedef void(GL_APIENTRY * | SecondaryColorPointerProc) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
typedef void(GL_APIENTRY * | MultiTexCoord4fProc) (GLenum target, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
typedef void(GL_APIENTRY * | VertexAttrib4fProc) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
typedef void(GL_APIENTRY * | VertexAttrib4fvProc) (GLuint index, const GLfloat *v)
typedef void(GL_APIENTRY * | VertexAttribPointerProc) (unsigned int, GLint, GLenum, GLboolean normalized, GLsizei stride, const GLvoid *pointer)
typedef void(GL_APIENTRY * | VertexAttribIPointerProc) (unsigned int, GLint, GLenum, GLsizei stride, const GLvoid *pointer)
typedef void(GL_APIENTRY * | VertexAttribLPointerProc) (unsigned int, GLint, GLenum, GLsizei stride, const GLvoid *pointer)
typedef void(GL_APIENTRY * | EnableVertexAttribProc) (unsigned int)
typedef void(GL_APIENTRY * | DisableVertexAttribProc) (unsigned int)
typedef void(GL_APIENTRY * | BindBufferProc) (GLenum target, GLuint buffer)
typedef void(GL_APIENTRY * | DrawArraysInstancedProc) (GLenum mode, GLint first, GLsizei count, GLsizei primcount)
typedef void(GL_APIENTRY * | DrawElementsInstancedProc) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)

## Protected Member Functions

virtual | ~State ()
void | setUpVertexAttribAlias (VertexAttribAlias &alias, GLuint location, const std::string glName, const std::string osgName, const std::string &declaration)
bool | applyMode (StateAttribute::GLMode mode, bool enabled, ModeStack &ms)
bool | applyModeOnTexUnit (unsigned int unit, StateAttribute::GLMode mode, bool enabled, ModeStack &ms)
bool | applyAttribute (const StateAttribute *attribute, AttributeStack &as)
bool | applyAttributeOnTexUnit (unsigned int unit, const StateAttribute *attribute, AttributeStack &as)
bool | applyGlobalDefaultAttribute (AttributeStack &as)
bool | applyGlobalDefaultAttributeOnTexUnit (unsigned int unit, AttributeStack &as)
ModeMap & | getOrCreateTextureModeMap (unsigned int unit)
AttributeMap & | getOrCreateTextureAttributeMap (unsigned int unit)
void | pushModeList (ModeMap &modeMap, const StateSet::ModeList &modeList)
void | pushAttributeList (AttributeMap &attributeMap, const StateSet::AttributeList &attributeList)
void | pushUniformList (UniformMap &uniformMap, const StateSet::UniformList &uniformList)
void | pushDefineList (DefineMap &defineMap, const StateSet::DefineList &defineList)
void | popModeList (ModeMap &modeMap, const StateSet::ModeList &modeList)
void | popAttributeList (AttributeMap &attributeMap, const StateSet::AttributeList &attributeList)
void | popUniformList (UniformMap &uniformMap, const StateSet::UniformList &uniformList)
void | popDefineList (DefineMap &uniformMap, const StateSet::DefineList &defineList)
void | applyModeList (ModeMap &modeMap, const StateSet::ModeList &modeList)
void | applyAttributeList (AttributeMap &attributeMap, const StateSet::AttributeList &attributeList)
void | applyUniformList (UniformMap &uniformMap, const StateSet::UniformList &uniformList)
void | applyDefineList (DefineMap &uniformMap, const StateSet::DefineList &defineList)
void | applyModeMap (ModeMap &modeMap)
void | applyAttributeMap (AttributeMap &attributeMap)
void | applyUniformMap (UniformMap &uniformMap)
void | applyModeListOnTexUnit (unsigned int unit, ModeMap &modeMap, const StateSet::ModeList &modeList)
void | applyAttributeListOnTexUnit (unsigned int unit, AttributeMap &attributeMap, const StateSet::AttributeList &attributeList)
void | applyModeMapOnTexUnit (unsigned int unit, ModeMap &modeMap)
void | applyAttributeMapOnTexUnit (unsigned int unit, AttributeMap &attributeMap)
void | haveAppliedMode (ModeMap &modeMap, StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
void | haveAppliedMode (ModeMap &modeMap, StateAttribute::GLMode mode)
void | haveAppliedAttribute (AttributeMap &attributeMap, const StateAttribute *attribute)
void | haveAppliedAttribute (AttributeMap &attributeMap, StateAttribute::Type type, unsigned int member)
bool | getLastAppliedMode (const ModeMap &modeMap, StateAttribute::GLMode mode) const
const StateAttribute * | getLastAppliedAttribute (const AttributeMap &attributeMap, StateAttribute::Type type, unsigned int member) const
void | loadModelViewMatrix ()
Protected Member Functions inherited from osg::Referenced
virtual | ~Referenced ()
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const
void | deleteUsingDeleteHandler () const

## Protected Attributes

GraphicsContext * | _graphicsContext
unsigned int | _contextID
osg::ref_ptr< VertexArrayState > | _globalVertexArrayState
VertexArrayState * | _vas
bool | _shaderCompositionEnabled
bool | _shaderCompositionDirty
osg::ref_ptr< ShaderComposer > | _shaderComposer
osg::Program * | _currentShaderCompositionProgram
StateSet::UniformList | _currentShaderCompositionUniformList
ref_ptr< FrameStamp > | _frameStamp
GLenum | _drawBuffer
GLenum | _readBuffer
ref_ptr< const RefMatrix > | _identity
ref_ptr< const RefMatrix > | _initialViewMatrix
ref_ptr< const RefMatrix > | _projection
ref_ptr< const RefMatrix > | _modelView
ref_ptr< RefMatrix > | _modelViewCache
bool | _useModelViewAndProjectionUniforms
ref_ptr< Uniform > | _modelViewMatrixUniform
ref_ptr< Uniform > | _projectionMatrixUniform
ref_ptr< Uniform > | _modelViewProjectionMatrixUniform
ref_ptr< Uniform > | _normalMatrixUniform
Matrix | _initialInverseViewMatrix
ref_ptr< DisplaySettings > | _displaySettings
bool * | _abortRenderingPtr
CheckForGLErrors | _checkGLErrors
bool | _useVertexAttributeAliasing
VertexAttribAlias | _vertexAlias
VertexAttribAlias | _normalAlias
VertexAttribAlias | _colorAlias
VertexAttribAlias | _secondaryColorAlias
VertexAttribAlias | _fogCoordAlias
VertexAttribAliasList | _texCoordAliasList
Program::AttribBindingList | _attributeBindingList
ModeMap | _modeMap
AttributeMap | _attributeMap
UniformMap | _uniformMap
DefineMap | _defineMap
TextureModeMapList | _textureModeMapList
TextureAttributeMapList | _textureAttributeMapList
const Program::PerContextProgram * | _lastAppliedProgramObject
StateSetStack | _stateStateStack
unsigned int | _maxTexturePoolSize
unsigned int | _maxBufferObjectPoolSize
unsigned int | _currentActiveTextureUnit
unsigned int | _currentClientActiveTextureUnit
GLBufferObject * | _currentPBO
GLBufferObject * | _currentDIBO
GLuint | _currentVAO
bool | _isSecondaryColorSupported
bool | _isFogCoordSupported
bool | _isVertexBufferObjectSupported
bool | _isVertexArrayObjectSupported
bool | _forceVertexBufferObject
bool | _forceVertexArrayObject
bool | _extensionProcsInitialized
GLint | _glMaxTextureCoords
GLint | _glMaxTextureUnits
ActiveTextureProc | _glClientActiveTexture
ActiveTextureProc | _glActiveTexture
MultiTexCoord4fProc | _glMultiTexCoord4f
VertexAttrib4fProc | _glVertexAttrib4f
VertexAttrib4fvProc | _glVertexAttrib4fv
FogCoordPointerProc | _glFogCoordPointer
SecondaryColorPointerProc | _glSecondaryColorPointer
VertexAttribPointerProc | _glVertexAttribPointer
VertexAttribIPointerProc | _glVertexAttribIPointer
VertexAttribLPointerProc | _glVertexAttribLPointer
EnableVertexAttribProc | _glEnableVertexAttribArray
DisableVertexAttribProc | _glDisableVertexAttribArray
BindBufferProc | _glBindBuffer
DrawArraysInstancedProc | _glDrawArraysInstanced
DrawElementsInstancedProc | _glDrawElementsInstanced
osg::ref_ptr< GLExtensions > | _glExtensions
unsigned int | _dynamicObjectCount
osg::ref_ptr< DynamicObjectRenderingCompletedCallback > | _completeDynamicObjectRenderingCallback
AttributeDispatchers | _arrayDispatchers
osg::ref_ptr< GraphicsCostEstimator > | _graphicsCostEstimator
Timer_t | _startTick
Timer_t | _gpuTick
GLuint64 | _gpuTimestamp
int | _timestampBits
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

Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings, implements lazy state updating and provides accessors for querying the current state. The venerable Red Book says that "OpenGL is a state machine", and this class represents the OpenGL state in OSG. Furthermore, `State` also has other important features:

- It works as a stack of states (see `pushStateSet()` and `popStateSet()`). Manipulating this stack of OpenGL states manually is seldom needed, since OSG does this in the most common situations.
- It implements lazy state updating. This means that, if one requests a state change and that particular state is already in the requested state, no OpenGL call will be made. This ensures that the OpenGL pipeline is not stalled by unnecessary state changes.
- It allows to query the current OpenGL state without calls to `glGet*`(), which typically stall the graphics pipeline (see, for instance, `captureCurrentState()` and `getModelViewMatrix()`).

## Member Typedef Documentation

## ActiveTextureProc

typedef void(GL_APIENTRY * osg::State::ActiveTextureProc) (GLenum texture)

protected

## AttributeMap

typedef std::map<StateAttribute::TypeMemberPair,AttributeStack> osg::State::AttributeMap

## AttributePair

typedef std::pair<const StateAttribute*,StateAttribute::OverrideValue> osg::State::AttributePair

## AttributeVec

typedef std::vector<AttributePair> osg::State::AttributeVec

## BindBufferProc

typedef void(GL_APIENTRY * osg::State::BindBufferProc) (GLenum target, GLuint buffer)

protected

## DisableVertexAttribProc

typedef void(GL_APIENTRY * osg::State::DisableVertexAttribProc) (unsigned int)

protected

## DrawArraysInstancedProc

typedef void(GL_APIENTRY * osg::State::DrawArraysInstancedProc) (GLenum mode, GLint first, GLsizei count, GLsizei primcount)

protected

## DrawElementsInstancedProc

typedef void(GL_APIENTRY * osg::State::DrawElementsInstancedProc) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount)

protected

## EnableVertexAttribProc

typedef void(GL_APIENTRY * osg::State::EnableVertexAttribProc) (unsigned int)

protected

## ExtensionMap

typedef std::map<const std::type_info*, osg::ref_ptr<osg::Referenced> > osg::State::ExtensionMap

## FogCoordPointerProc

typedef void(GL_APIENTRY * osg::State::FogCoordPointerProc) (GLenum type, GLsizei stride, const GLvoid *pointer)

protected

## IndicesGLuint

typedef std::vector<GLuint> osg::State::IndicesGLuint

## IndicesGLushort

typedef std::vector<GLushort> osg::State::IndicesGLushort

## MatrixStack

typedef std::vector< ref_ptr<const Matrix> > osg::State::MatrixStack

## ModeMap

typedef std::map<StateAttribute::GLMode,ModeStack> osg::State::ModeMap

## MultiTexCoord4fProc

typedef void(GL_APIENTRY * osg::State::MultiTexCoord4fProc) (GLenum target, GLfloat x, GLfloat y, GLfloat z, GLfloat w)

protected

## SecondaryColorPointerProc

typedef void(GL_APIENTRY * osg::State::SecondaryColorPointerProc) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)

protected

## StateSetStack

typedef std::vector<const StateSet*> osg::State::StateSetStack

## TextureAttributeMapList

typedef std::vector<AttributeMap> osg::State::TextureAttributeMapList

## TextureModeMapList

typedef std::vector<ModeMap> osg::State::TextureModeMapList

## UniformMap

typedef std::map<std::string, UniformStack> osg::State::UniformMap

## VertexAttrib4fProc

typedef void(GL_APIENTRY * osg::State::VertexAttrib4fProc) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)

protected

## VertexAttrib4fvProc

typedef void(GL_APIENTRY * osg::State::VertexAttrib4fvProc) (GLuint index, const GLfloat *v)

protected

## VertexAttribAliasList

typedef std::vector<VertexAttribAlias> osg::State::VertexAttribAliasList

## VertexAttribIPointerProc

typedef void(GL_APIENTRY * osg::State::VertexAttribIPointerProc) (unsigned int, GLint, GLenum, GLsizei stride, const GLvoid *pointer)

protected

## VertexAttribLPointerProc

typedef void(GL_APIENTRY * osg::State::VertexAttribLPointerProc) (unsigned int, GLint, GLenum, GLsizei stride, const GLvoid *pointer)

protected

## VertexAttribPointerProc

typedef void(GL_APIENTRY * osg::State::VertexAttribPointerProc) (unsigned int, GLint, GLenum, GLboolean normalized, GLsizei stride, const GLvoid *pointer)

protected

## Member Enumeration Documentation

## CheckForGLErrors

enum osg::State::CheckForGLErrors

Enumerator
NEVER_CHECK_GL_ERRORS | NEVER_CHECK_GL_ERRORS hints that OpenGL need not be checked for, this is the fastest option since checking for errors does incur a small overhead.
ONCE_PER_FRAME | ONCE_PER_FRAME means that OpenGL errors will be checked for once per frame, the overhead is still small, but at least OpenGL errors that are occurring will be caught, the reporting isn't fine grained enough for debugging purposes.
ONCE_PER_ATTRIBUTE | ONCE_PER_ATTRIBUTE means that OpenGL errors will be checked for after every attribute is applied, allow errors to be directly associated with particular operations which makes debugging much easier.

## Constructor & Destructor Documentation

## State()

osg::State::State | ( |  | ) |

## ~State()

virtual osg::State::~State | ( |  | ) |

protected virtual

## Member Function Documentation

## apply() [1/2]

void osg::State::apply | ( |  | ) |

Updates the OpenGL state so that it matches the `StateSet` at the top of the stack of StateSets maintained internally by a `State`.

## apply() [2/2]

void osg::State::apply | ( | const StateSet * | dstate | ) |

Apply stateset.

## applyAttribute() [1/2]

bool osg::State::applyAttribute | ( | const StateAttribute * | attribute | ) |

inline

Apply an attribute if required.

References _attributeMap, applyAttribute(), osg::State::AttributeStack::changed, and osg::StateAttribute::getTypeMemberPair().

Referenced by applyAttribute(), applyAttributeList(), and applyAttributeMap().

## applyAttribute() [2/2]

bool osg::State::applyAttribute | ( | const StateAttribute * | attribute,
|  | AttributeStack & | as )

inline protected

apply an attribute if required, passing in attribute and appropriate attribute stack

References _checkGLErrors, _shaderCompositionDirty, osg::StateAttribute::apply(), osg::Object::asStateAttribute(), checkGLErrors(), osg::StateAttribute::cloneType(), osg::StateAttribute::getShaderComponent(), osg::State::AttributeStack::global_default_attribute, osg::State::AttributeStack::last_applied_attribute, osg::State::AttributeStack::last_applied_shadercomponent, and ONCE_PER_ATTRIBUTE.

## applyAttributeList()

void osg::State::applyAttributeList | ( | AttributeMap & | attributeMap,
|  | const StateSet::AttributeList & | attributeList )

inline protected

References applyAttribute(), applyGlobalDefaultAttribute(), osg::State::AttributeStack::attributeVec, osg::State::AttributeStack::changed, osg::StateAttribute::OVERRIDE, and osg::StateAttribute::PROTECTED.

## applyAttributeListOnTexUnit()

void osg::State::applyAttributeListOnTexUnit | ( | unsigned int | unit,
|  | AttributeMap & | attributeMap,
|  | const StateSet::AttributeList & | attributeList )

inline protected

References applyAttributeOnTexUnit(), applyGlobalDefaultAttributeOnTexUnit(), osg::State::AttributeStack::attributeVec, osg::State::AttributeStack::changed, osg::StateAttribute::OVERRIDE, and osg::StateAttribute::PROTECTED.

## applyAttributeMap()

void osg::State::applyAttributeMap | ( | AttributeMap & | attributeMap | ) |

inline protected

References applyAttribute(), applyGlobalDefaultAttribute(), osg::State::AttributeStack::attributeVec, and osg::State::AttributeStack::changed.

## applyAttributeMapOnTexUnit()

void osg::State::applyAttributeMapOnTexUnit | ( | unsigned int | unit,
|  | AttributeMap & | attributeMap )

inline protected

References applyAttributeOnTexUnit(), applyGlobalDefaultAttributeOnTexUnit(), osg::State::AttributeStack::attributeVec, and osg::State::AttributeStack::changed.

## applyAttributeOnTexUnit()

bool osg::State::applyAttributeOnTexUnit | ( | unsigned int | unit,
|  | const StateAttribute * | attribute,
|  | AttributeStack & | as )

inline protected

References _checkGLErrors, _shaderCompositionDirty, osg::StateAttribute::apply(), osg::Object::asStateAttribute(), checkGLErrors(), osg::StateAttribute::cloneType(), osg::StateAttribute::getShaderComponent(), osg::State::AttributeStack::global_default_attribute, osg::State::AttributeStack::last_applied_attribute, osg::State::AttributeStack::last_applied_shadercomponent, ONCE_PER_ATTRIBUTE, and setActiveTextureUnit().

Referenced by applyAttributeListOnTexUnit(), applyAttributeMapOnTexUnit(), and applyTextureAttribute().

## applyDefineList()

void osg::State::applyDefineList | ( | DefineMap & | uniformMap,
|  | const StateSet::DefineList & | defineList )

inline protected

References osg::State::DefineMap::changed, osg::State::DefineMap::currentDefines, osg::State::DefineStack::defineVec, osg::State::DefineMap::map, osg::StateAttribute::ON, osg::StateAttribute::OVERRIDE, and osg::StateAttribute::PROTECTED.

## applyDisablingOfVertexAttributes()

void osg::State::applyDisablingOfVertexAttributes | ( |  | ) |

inline

References _vas.

## applyGlobalDefaultAttribute()

bool osg::State::applyGlobalDefaultAttribute | ( | AttributeStack & | as | ) |

inline protected

References _checkGLErrors, _shaderCompositionDirty, checkGLErrors(), osg::State::AttributeStack::global_default_attribute, osg::State::AttributeStack::last_applied_attribute, osg::State::AttributeStack::last_applied_shadercomponent, and ONCE_PER_ATTRIBUTE.

Referenced by applyAttributeList(), and applyAttributeMap().

## applyGlobalDefaultAttributeOnTexUnit()

bool osg::State::applyGlobalDefaultAttributeOnTexUnit | ( | unsigned int | unit,
|  | AttributeStack & | as )

inline protected

References _checkGLErrors, _shaderCompositionDirty, checkGLErrors(), osg::State::AttributeStack::global_default_attribute, osg::State::AttributeStack::last_applied_attribute, osg::State::AttributeStack::last_applied_shadercomponent, ONCE_PER_ATTRIBUTE, and setActiveTextureUnit().

Referenced by applyAttributeListOnTexUnit(), and applyAttributeMapOnTexUnit().

## applyMode() [1/2]

bool osg::State::applyMode | ( | StateAttribute::GLMode | mode,
|  | bool | enabled )

inline

Apply an OpenGL mode if required. This is a wrapper around `glEnable()` and `glDisable()`, that just actually calls these functions if the `enabled` flag is different than the current state.

Returns
  `true` if the state was actually changed. `false` otherwise. Notice that a `false` return does not indicate an error, it just means that the mode was already set to the same value as the `enabled` parameter.

References _modeMap, applyMode(), and osg::State::ModeStack::changed.

Referenced by applyMode(), applyModeList(), and applyModeMap().

## applyMode() [2/2]

bool osg::State::applyMode | ( | StateAttribute::GLMode | mode,
|  | bool | enabled,
|  | ModeStack & | ms )

inline protected

Apply an OpenGL mode if required, passing in mode, enable flag and appropriate mode stack. This is a wrapper around `glEnable()` and `glDisable()`, that just actually calls these functions if the `enabled` flag is different than the current state.

Returns
  `true` if the state was actually changed. `false` otherwise. Notice that a `false` return does not indicate an error, it just means that the mode was already set to the same value as the `enabled` parameter.

References _checkGLErrors, checkGLErrors(), osg::State::ModeStack::last_applied_value, ONCE_PER_ATTRIBUTE, and osg::State::ModeStack::valid.

## applyModeList()

void osg::State::applyModeList | ( | ModeMap & | modeMap,
|  | const StateSet::ModeList & | modeList )

inline protected

References applyMode(), osg::State::ModeStack::changed, osg::State::ModeStack::global_default_value, osg::StateAttribute::ON, osg::StateAttribute::OVERRIDE, osg::StateAttribute::PROTECTED, and osg::State::ModeStack::valueVec.

## applyModeListOnTexUnit()

void osg::State::applyModeListOnTexUnit | ( | unsigned int | unit,
|  | ModeMap & | modeMap,
|  | const StateSet::ModeList & | modeList )

inline protected

References applyModeOnTexUnit(), osg::State::ModeStack::changed, osg::State::ModeStack::global_default_value, osg::StateAttribute::ON, osg::StateAttribute::OVERRIDE, osg::StateAttribute::PROTECTED, and osg::State::ModeStack::valueVec.

## applyModelViewAndProjectionUniformsIfRequired()

void osg::State::applyModelViewAndProjectionUniformsIfRequired | ( |  | ) |

## applyModelViewMatrix() [1/2]

void osg::State::applyModelViewMatrix | ( | const osg::Matrix & |  | ) |

## applyModelViewMatrix() [2/2]

void osg::State::applyModelViewMatrix | ( | const osg::RefMatrix * | matrix | ) |

## applyModeMap()

void osg::State::applyModeMap | ( | ModeMap & | modeMap | ) |

inline protected

References applyMode(), osg::State::ModeStack::changed, osg::State::ModeStack::global_default_value, osg::StateAttribute::ON, and osg::State::ModeStack::valueVec.

## applyModeMapOnTexUnit()

void osg::State::applyModeMapOnTexUnit | ( | unsigned int | unit,
|  | ModeMap & | modeMap )

inline protected

References applyModeOnTexUnit(), osg::State::ModeStack::changed, osg::State::ModeStack::global_default_value, osg::StateAttribute::ON, and osg::State::ModeStack::valueVec.

## applyModeOnTexUnit()

bool osg::State::applyModeOnTexUnit | ( | unsigned int | unit,
|  | StateAttribute::GLMode | mode,
|  | bool | enabled,
|  | ModeStack & | ms )

inline protected

References _checkGLErrors, checkGLErrors(), osg::State::ModeStack::last_applied_value, ONCE_PER_ATTRIBUTE, setActiveTextureUnit(), and osg::State::ModeStack::valid.

Referenced by applyModeListOnTexUnit(), applyModeMapOnTexUnit(), and applyTextureMode().

## applyProjectionMatrix()

void osg::State::applyProjectionMatrix | ( | const osg::RefMatrix * | matrix | ) |

## applyShaderComposition()

void osg::State::applyShaderComposition | ( |  | ) |

Apply any shader composed state.

## applyShaderCompositionUniform()

void osg::State::applyShaderCompositionUniform | ( | const osg::Uniform * | uniform,
|  | StateAttribute::OverrideValue | value = StateAttribute::ON )

inline

Convenience method for StateAttribute::apply(State&) methods to pass on their uniforms to osg::State so it can apply them at the appropriate point.

References _currentShaderCompositionUniformList, osg::Object::getName(), and osg::StateAttribute::ON.

## applyTextureAttribute()

bool osg::State::applyTextureAttribute | ( | unsigned int | unit,
|  | const StateAttribute * | attribute )

inline

References applyAttributeOnTexUnit(), osg::State::AttributeStack::changed, getOrCreateTextureAttributeMap(), and osg::StateAttribute::getTypeMemberPair().

## applyTextureMode()

bool osg::State::applyTextureMode | ( | unsigned int | unit,
|  | StateAttribute::GLMode | mode,
|  | bool | enabled )

inline

References applyModeOnTexUnit(), osg::State::ModeStack::changed, and getOrCreateTextureModeMap().

## applyUniformList()

void osg::State::applyUniformList | ( | UniformMap & | uniformMap,
|  | const StateSet::UniformList & | uniformList )

inline protected

References _lastAppliedProgramObject, osg::StateAttribute::OVERRIDE, osg::StateAttribute::PROTECTED, and osg::State::UniformStack::uniformVec.

## applyUniformMap()

void osg::State::applyUniformMap | ( | UniformMap & | uniformMap | ) |

inline protected

References _lastAppliedProgramObject, and osg::State::UniformStack::uniformVec.

## bindDrawIndirectBufferObject()

void osg::State::bindDrawIndirectBufferObject | ( | osg::GLBufferObject * | ibo | ) |

inline

References _currentDIBO, osg::GLBufferObject::bindBuffer(), osg::GLBufferObject::compileBuffer(), and osg::GLBufferObject::isDirty().

## bindElementBufferObject()

void osg::State::bindElementBufferObject | ( | osg::GLBufferObject * | ebo | ) |

inline

References _vas.

## bindPixelBufferObject()

void osg::State::bindPixelBufferObject | ( | osg::GLBufferObject * | pbo | ) |

inline

References _currentPBO, osg::GLBufferObject::bindBuffer(), osg::GLBufferObject::compileBuffer(), osg::GLBufferObject::isDirty(), and unbindPixelBufferObject().

## bindVertexArrayObject() [1/2]

void osg::State::bindVertexArrayObject | ( | const VertexArrayState * | vas | ) |

inline

References bindVertexArrayObject(), and osg::VertexArrayState::getVertexArrayObject().

Referenced by bindVertexArrayObject(), and osg::Drawable::draw().

## bindVertexArrayObject() [2/2]

void osg::State::bindVertexArrayObject | ( | GLuint | vao | ) |

inline

References _currentVAO, and _glExtensions.

## bindVertexBufferObject()

void osg::State::bindVertexBufferObject | ( | osg::GLBufferObject * | vbo | ) |

inline

References _vas.

## captureCurrentState()

void osg::State::captureCurrentState | ( | StateSet & | stateset | ) | const

Copy the modes and attributes which capture the current state.

## checkGLErrors() [1/3]

bool osg::State::checkGLErrors | ( | const char * | str1 = 0,
|  | const char * | str2 = 0 ) const

Referenced by applyAttribute(), applyAttributeOnTexUnit(), applyGlobalDefaultAttribute(), applyGlobalDefaultAttributeOnTexUnit(), applyMode(), and applyModeOnTexUnit().

## checkGLErrors() [2/3]

bool osg::State::checkGLErrors | ( | const StateAttribute * | attribute | ) | const

## checkGLErrors() [3/3]

bool osg::State::checkGLErrors | ( | StateAttribute::GLMode | mode | ) | const

## Color()

void osg::State::Color | ( | float | r,
|  | float | g,
|  | float | b,
|  | float | a = 1.0f )

inline

References _colorAlias, _glVertexAttrib4f, and _useVertexAttributeAliasing.

## convertVertexShaderSourceToOsgBuiltIns()

bool osg::State::convertVertexShaderSourceToOsgBuiltIns | ( | std::string & | source | ) | const

## decrementDynamicObjectCount()

void osg::State::decrementDynamicObjectCount | ( |  | ) |

inline

Decrement the number of dynamic objects left to render this frame, and once the count goes to zero call the DynamicObjectRenderingCompletedCallback to inform of completion.

References _completeDynamicObjectRenderingCallback, and _dynamicObjectCount.

## dirtyAllAttributes()

void osg::State::dirtyAllAttributes | ( |  | ) |

Dirty the modes attributes previously applied in osg::State.

## dirtyAllModes()

void osg::State::dirtyAllModes | ( |  | ) |

Dirty the modes previously applied in osg::State.

## dirtyAllVertexArrays()

void osg::State::dirtyAllVertexArrays | ( |  | ) |

dirty the vertex, normal, color, tex coords, secondary color, fog coord and index arrays.

## disableAllVertexArrays()

void osg::State::disableAllVertexArrays | ( |  | ) |

disable the vertex, normal, color, tex coords, secondary color, fog coord and index arrays.

## disableColorPointer()

void osg::State::disableColorPointer | ( |  | ) |

inline

References _vas.

## disableFogCoordPointer()

void osg::State::disableFogCoordPointer | ( |  | ) |

inline

References _vas.

## disableNormalPointer()

void osg::State::disableNormalPointer | ( |  | ) |

inline

References _vas.

## disableSecondaryColorPointer()

void osg::State::disableSecondaryColorPointer | ( |  | ) |

inline

References _vas.

## disableTexCoordPointer()

void osg::State::disableTexCoordPointer | ( | unsigned int | unit | ) |

inline

References _vas.

## disableTexCoordPointersAboveAndIncluding()

void osg::State::disableTexCoordPointersAboveAndIncluding | ( | unsigned int | unit | ) |

inline

References _vas.

## disableVertexAttribPointer()

void osg::State::disableVertexAttribPointer | ( | unsigned int | index | ) |

inline

References _vas.

## disableVertexAttribPointersAboveAndIncluding()

void osg::State::disableVertexAttribPointersAboveAndIncluding | ( | unsigned int | index | ) |

inline

References _vas.

## disableVertexPointer()

void osg::State::disableVertexPointer | ( |  | ) |

inline

References _vas.

## drawQuads()

void osg::State::drawQuads | ( | GLint | first,
|  | GLsizei | count,
|  | GLsizei | primCount = 0 )

## frameCompleted()

virtual void osg::State::frameCompleted | ( |  | ) |

virtual

called by the GraphicsContext just before GraphicsContext::swapBuffersImplementation().

## get() [1/4]

template<>

GLExtensions * osg::State::get | ( |  | ) |

inline

References _glExtensions.

## get() [2/4]

template<typename T>

T * osg::State::get | ( |  | ) |

inline

Get a specific GL extensions object or GraphicsObjectManager, initialize if not already present. Note, must only be called from a the graphics context thread associated with this osg::State.

References _contextID, _extensionMap, and osg::ref_ptr< T >::get().

## get() [3/4]

template<>

const GLExtensions * osg::State::get | ( |  | ) | const

inline

References _glExtensions.

## get() [4/4]

template<typename T>

const T * osg::State::get | ( |  | ) | const

inline

Get a specific GL extensions object or GraphicsObjectManager if it already exists in the extension map. Note, safe to call outwith a the graphics context thread associated with this osg::State. Returns NULL if the desired extension object has not been created yet.

References _extensionMap.

## getAbortRendering()

bool osg::State::getAbortRendering | ( |  | ) | const

inline

Get flag for early termination of the draw traversal, if true steps should be taken to complete rendering early.

References _abortRenderingPtr.

## getActiveDisplaySettings() [1/2]

DisplaySettings * osg::State::getActiveDisplaySettings | ( |  | ) |

inline

Get the DisplaySettings that is current active DisplaySettings to be used by osg::State, - if DisplaySettings is not directly assigned then fallback to DisplaySettings::instance().

References _displaySettings, and osg::DisplaySettings::instance().

## getActiveDisplaySettings() [2/2]

const DisplaySettings * osg::State::getActiveDisplaySettings | ( |  | ) | const

inline

Get the const DisplaySettings that is current active DisplaySettings to be used by osg::State, - if DisplaySettings is not directly assigned then fallback to DisplaySettings::instance().

References _displaySettings, and osg::DisplaySettings::instance().

## getActiveTextureUnit()

unsigned int osg::State::getActiveTextureUnit | ( |  | ) | const

inline

Get the current texture unit.

References _currentActiveTextureUnit.

## getAttribLocation()

GLint osg::State::getAttribLocation | ( | const std::string & | name | ) | const

inline

References _lastAppliedProgramObject.

## getAttributeBindingList()

const Program::AttribBindingList & osg::State::getAttributeBindingList | ( |  | ) |

inline

References _attributeBindingList.

## getAttributeDispatchers()

AttributeDispatchers & osg::State::getAttributeDispatchers | ( |  | ) |

inline

Get the helper class for dispatching osg::Arrays as OpenGL attribute data.

References _arrayDispatchers.

## getAttributeMap()

const AttributeMap & osg::State::getAttributeMap | ( |  | ) | const

inline

References _attributeMap.

## getAttributeVec()

AttributeVec & osg::State::getAttributeVec | ( | const osg::StateAttribute * | attribute | ) |

inline

References _attributeMap, osg::State::AttributeStack::attributeVec, and osg::StateAttribute::getTypeMemberPair().

## getCheckForGLErrors()

CheckForGLErrors osg::State::getCheckForGLErrors | ( |  | ) | const

inline

Get whether and how often OpenGL errors should be checked for.

References _checkGLErrors.

## getClientActiveTextureUnit()

unsigned int osg::State::getClientActiveTextureUnit | ( |  | ) | const

Get the current tex coord array texture unit.

## getColorAlias()

const VertexAttribAlias & osg::State::getColorAlias | ( |  | ) |

inline

References _colorAlias.

## getContextID()

unsigned int osg::State::getContextID | ( |  | ) | const

inline

Get the current OpenGL context unique ID.

References _contextID.

Referenced by osg::Texture2D::SubloadCallback::generateTextureObject().

## getCurrentElementBufferObject()

const GLBufferObject * osg::State::getCurrentElementBufferObject | ( |  | ) |

inline

References _vas.

## getCurrentPixelBufferObject()

const GLBufferObject * osg::State::getCurrentPixelBufferObject | ( |  | ) | const

inline

References _currentPBO.

## getCurrentShaderCompositionUniformList()

StateSet::UniformList & osg::State::getCurrentShaderCompositionUniformList | ( |  | ) |

inline

Get the unform list in which to inject any uniforms that StateAttribute::apply(State&) methods provide.

References _currentShaderCompositionUniformList.

## getCurrentVertexArrayObject()

GLuint osg::State::getCurrentVertexArrayObject | ( |  | ) | const

inline

References _currentVAO.

## getCurrentVertexArrayState()

VertexArrayState * osg::State::getCurrentVertexArrayState | ( |  | ) | const

inline

Get the CurrentVetexArrayState object that take which vertex arrays are bound.

References _vas.

Referenced by osg::Drawable::draw().

## getCurrentVertexBufferObject()

const GLBufferObject * osg::State::getCurrentVertexBufferObject | ( |  | ) |

inline

References _vas.

## getCurrentViewport()

const Viewport * osg::State::getCurrentViewport | ( |  | ) | const

inline

References getLastAppliedAttribute(), and osg::StateAttribute::VIEWPORT.

## getDefineMap() [1/2]

DefineMap & osg::State::getDefineMap | ( |  | ) |

inline

References _defineMap.

## getDefineMap() [2/2]

const DefineMap & osg::State::getDefineMap | ( |  | ) | const

inline

References _defineMap.

## getDefineString()

std::string osg::State::getDefineString | ( | const osg::ShaderDefines & | shaderDefines | ) |

## getDisplaySettings()

const DisplaySettings * osg::State::getDisplaySettings | ( |  | ) | const

inline

Get the const DisplaySettings

References _displaySettings.

## getDrawBuffer()

GLenum osg::State::getDrawBuffer | ( |  | ) | const

inline

References _drawBuffer.

## getDynamicObjectCount()

unsigned int osg::State::getDynamicObjectCount | ( |  | ) | const

inline

Get the number of dynamic objects that will be rendered in this graphics context this frame.

References _dynamicObjectCount.

## getDynamicObjectRenderingCompletedCallback()

DynamicObjectRenderingCompletedCallback * osg::State::getDynamicObjectRenderingCompletedCallback | ( |  | ) |

inline

Get the callback to be called when the dynamic object count hits 0.

References _completeDynamicObjectRenderingCallback.

## getFogCoordAlias()

const VertexAttribAlias & osg::State::getFogCoordAlias | ( |  | ) |

inline

References _fogCoordAlias.

## getFrameStamp() [1/2]

FrameStamp * osg::State::getFrameStamp | ( |  | ) |

inline

Get the frame stamp for the current frame.

References _frameStamp.

## getFrameStamp() [2/2]

const FrameStamp * osg::State::getFrameStamp | ( |  | ) | const

inline

Get the const frame stamp for the current frame.

References _frameStamp.

## getGlobalDefaultAttribute()

const StateAttribute * osg::State::getGlobalDefaultAttribute | ( | StateAttribute::Type | type,
|  | unsigned int | member = 0 )

inline

References _attributeMap, and osg::State::AttributeStack::global_default_attribute.

## getGlobalDefaultModeValue()

bool osg::State::getGlobalDefaultModeValue | ( | StateAttribute::GLMode | mode | ) |

inline

References _modeMap.

## getGlobalDefaultTextureAttribute()

const StateAttribute * osg::State::getGlobalDefaultTextureAttribute | ( | unsigned int | unit,
|  | StateAttribute::Type | type,
|  | unsigned int | member = 0 )

inline

References getOrCreateTextureAttributeMap(), and osg::State::AttributeStack::global_default_attribute.

## getGlobalDefaultTextureModeValue()

bool osg::State::getGlobalDefaultTextureModeValue | ( | unsigned int | unit,
|  | StateAttribute::GLMode | mode )

inline

References getOrCreateTextureModeMap(), and osg::State::ModeStack::global_default_value.

## getGpuTick()

Timer_t osg::State::getGpuTick | ( |  | ) | const

inline

References _gpuTick.

## getGpuTime()

double osg::State::getGpuTime | ( |  | ) | const

inline

References _gpuTick, _startTick, osg::Timer::delta_s(), and osg::Timer::instance().

## getGpuTimestamp()

GLuint64 osg::State::getGpuTimestamp | ( |  | ) | const

inline

References _gpuTimestamp.

## getGraphicsContext() [1/2]

GraphicsContext * osg::State::getGraphicsContext | ( |  | ) |

inline

Get the graphics context associated with that owns this State object.

References _graphicsContext.

## getGraphicsContext() [2/2]

const GraphicsContext * osg::State::getGraphicsContext | ( |  | ) | const

inline

Get the const graphics context associated with that owns this State object.

References _graphicsContext.

## getGraphicsCostEstimator() [1/2]

GraphicsCostEstimator * osg::State::getGraphicsCostEstimator | ( |  | ) |

inline

Get the helper class that provides applications with estimate on how much different graphics operations will cost.

References _graphicsCostEstimator.

## getGraphicsCostEstimator() [2/2]

const GraphicsCostEstimator * osg::State::getGraphicsCostEstimator | ( |  | ) | const

inline

Get the cont helper class that provides applications with estimate on how much different graphics operations will cost.

References _graphicsCostEstimator.

## getInitialInverseViewMatrix()

const osg::Matrix & osg::State::getInitialInverseViewMatrix | ( |  | ) | const

inline

References _initialInverseViewMatrix.

## getInitialViewMatrix()

const osg::Matrix & osg::State::getInitialViewMatrix | ( |  | ) | const

inline

References _initialViewMatrix.

## getLastAppliedAttribute() [1/2]

const StateAttribute * osg::State::getLastAppliedAttribute | ( | const AttributeMap & | attributeMap,
|  | StateAttribute::Type | type,
|  | unsigned int | member ) const

protected

## getLastAppliedAttribute() [2/2]

const StateAttribute * osg::State::getLastAppliedAttribute | ( | StateAttribute::Type | type,
|  | unsigned int | member = 0 ) const

Get the current specified attribute, return NULL if one has not yet been applied.

Referenced by getCurrentViewport().

## getLastAppliedMode() [1/2]

bool osg::State::getLastAppliedMode | ( | const ModeMap & | modeMap,
|  | StateAttribute::GLMode | mode ) const

protected

## getLastAppliedMode() [2/2]

bool osg::State::getLastAppliedMode | ( | StateAttribute::GLMode | mode | ) | const

Get whether the current specified mode is enabled (true) or disabled (false).

## getLastAppliedModeValue()

bool osg::State::getLastAppliedModeValue | ( | StateAttribute::GLMode | mode | ) |

inline

References _modeMap.

## getLastAppliedProgramObject()

const Program::PerContextProgram * osg::State::getLastAppliedProgramObject | ( |  | ) | const

inline

References _lastAppliedProgramObject.

## getLastAppliedTextureAttribute()

const StateAttribute * osg::State::getLastAppliedTextureAttribute | ( | unsigned int | unit,
|  | StateAttribute::Type | type,
|  | unsigned int | member = 0 ) const

Get the current specified texture attribute, return NULL if one has not yet been applied.

## getLastAppliedTextureMode()

bool osg::State::getLastAppliedTextureMode | ( | unsigned int | unit,
|  | StateAttribute::GLMode | mode ) const

Get whether the current specified texture mode is enabled (true) or disabled (false).

## getLastAppliedTextureModeValue()

bool osg::State::getLastAppliedTextureModeValue | ( | unsigned int | unit,
|  | StateAttribute::GLMode | mode )

inline

References getOrCreateTextureModeMap(), and osg::State::ModeStack::last_applied_value.

## getMaxBufferObjectPoolSize()

unsigned int osg::State::getMaxBufferObjectPoolSize | ( |  | ) | const

inline

References _maxBufferObjectPoolSize.

## getMaxTextureCoords()

GLint osg::State::getMaxTextureCoords | ( |  | ) | const

inline

For GL>=2.0 uses GL_MAX_TEXTURE_COORDS, for GL<2 uses GL_MAX_TEXTURE_UNITS.

References _glMaxTextureCoords.

## getMaxTexturePoolSize()

unsigned int osg::State::getMaxTexturePoolSize | ( |  | ) | const

inline

References _maxTexturePoolSize.

Referenced by osg::Texture::isSafeToUnrefImageData().

## getMaxTextureUnits()

GLint osg::State::getMaxTextureUnits | ( |  | ) | const

inline

For GL>=2.0 uses GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, for GL<2 uses GL_MAX_TEXTURE_UNITS.

References _glMaxTextureUnits.

## getModelViewMatrix()

const osg::Matrix & osg::State::getModelViewMatrix | ( |  | ) | const

inline

References _modelView.

## getModelViewMatrixUniform()

osg::Uniform * osg::State::getModelViewMatrixUniform | ( |  | ) |

inline

References _modelViewMatrixUniform.

## getModelViewProjectionMatrixUniform()

osg::Uniform * osg::State::getModelViewProjectionMatrixUniform | ( |  | ) |

inline

References _modelViewProjectionMatrixUniform.

## getModeMap()

const ModeMap & osg::State::getModeMap | ( |  | ) | const

inline

References _modeMap.

## getModeValidity()

bool osg::State::getModeValidity | ( | StateAttribute::GLMode | mode | ) |

inline

Get 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.

References _modeMap, and osg::State::ModeStack::valid.

## getNormalAlias()

const VertexAttribAlias & osg::State::getNormalAlias | ( |  | ) |

inline

References _normalAlias.

## getNormalMatrixUniform()

osg::Uniform * osg::State::getNormalMatrixUniform | ( |  | ) |

inline

References _normalMatrixUniform.

## getOrCreateTextureAttributeMap()

AttributeMap & osg::State::getOrCreateTextureAttributeMap | ( | unsigned int | unit | ) |

inline protected

References _textureAttributeMapList.

Referenced by applyTextureAttribute(), getGlobalDefaultTextureAttribute(), and setGlobalDefaultTextureAttribute().

## getOrCreateTextureModeMap()

ModeMap & osg::State::getOrCreateTextureModeMap | ( | unsigned int | unit | ) |

inline protected

References _textureModeMapList.

Referenced by applyTextureMode(), getGlobalDefaultTextureModeValue(), getLastAppliedTextureModeValue(), and setGlobalDefaultTextureModeValue().

## getProjectionMatrix()

const osg::Matrix & osg::State::getProjectionMatrix | ( |  | ) | const

inline

References _projection.

## getProjectionMatrixUniform()

osg::Uniform * osg::State::getProjectionMatrixUniform | ( |  | ) |

inline

References _projectionMatrixUniform.

## getReadBuffer()

GLenum osg::State::getReadBuffer | ( |  | ) | const

inline

References _readBuffer.

## getSecondaryColorAlias()

const VertexAttribAlias & osg::State::getSecondaryColorAlias | ( |  | ) |

inline

References _secondaryColorAlias.

## getShaderComposer() [1/2]

ShaderComposer * osg::State::getShaderComposer | ( |  | ) |

inline

deprecated.

References _shaderComposer.

## getShaderComposer() [2/2]

const ShaderComposer * osg::State::getShaderComposer | ( |  | ) | const

inline

deprecated.

References _shaderComposer.

## getShaderCompositionEnabled()

bool osg::State::getShaderCompositionEnabled | ( |  | ) | const

inline

References _shaderCompositionEnabled.

## getStartTick()

Timer_t osg::State::getStartTick | ( |  | ) | const

inline

Support for synchronizing the system time and the timestamp counter available with ARB_timer_query. Note that State doesn't update these values itself.

References _startTick.

## getStateSetStack()

StateSetStack & osg::State::getStateSetStack | ( |  | ) |

inline

Get the StateSet stack.

References _stateStateStack.

## getStateSetStackSize()

unsigned int osg::State::getStateSetStackSize | ( |  | ) |

inline

Get the number of StateSet's on the StateSet stack.

References _stateStateStack.

## getTexCoordAliasList()

const VertexAttribAliasList & osg::State::getTexCoordAliasList | ( |  | ) |

inline

References _texCoordAliasList.

## getTextureAttributeMapList()

const TextureAttributeMapList & osg::State::getTextureAttributeMapList | ( |  | ) | const

inline

References _textureAttributeMapList.

## getTextureModeMapList()

const TextureModeMapList & osg::State::getTextureModeMapList | ( |  | ) | const

inline

References _textureModeMapList.

## getTimestampBits()

int osg::State::getTimestampBits | ( |  | ) | const

inline

References _timestampBits.

## getUniformLocation() [1/2]

GLint osg::State::getUniformLocation | ( | const std::string & | uniformName | ) | const

inline

Alternative version of getUniformLocation( unsigned int uniformNameID ) retrofited into OSG for backward compatibility with osgCal, after uniform ids were refactored from std::strings to GLints in OSG version 2.9.10.

Drawbacks: This method is not particularly fast. It has to access mutexed static map of uniform ids. So don't overuse it or your app performance will suffer.

References _lastAppliedProgramObject.

## getUniformLocation() [2/2]

GLint osg::State::getUniformLocation | ( | unsigned int | uniformNameID | ) | const

inline

References _lastAppliedProgramObject.

## getUniformMap()

const UniformMap & osg::State::getUniformMap | ( |  | ) | const

inline

References _uniformMap.

## getUseModelViewAndProjectionUniforms()

bool osg::State::getUseModelViewAndProjectionUniforms | ( |  | ) | const

inline

References _useModelViewAndProjectionUniforms.

## getUseVertexAttributeAliasing()

bool osg::State::getUseVertexAttributeAliasing | ( |  | ) | const

inline

References _useVertexAttributeAliasing.

## getVertexAlias()

const VertexAttribAlias & osg::State::getVertexAlias | ( |  | ) |

inline

References _vertexAlias.

## getViewFrustum()

Polytope osg::State::getViewFrustum | ( |  | ) | const

## glDrawArraysInstanced()

void osg::State::glDrawArraysInstanced | ( | GLenum | mode,
|  | GLint | first,
|  | GLsizei | count,
|  | GLsizei | primcount )

inline

References _glDrawArraysInstanced.

## glDrawBuffer()

void osg::State::glDrawBuffer | ( | GLenum | buffer | ) |

## glDrawElementsInstanced()

void osg::State::glDrawElementsInstanced | ( | GLenum | mode,
|  | GLsizei | count,
|  | GLenum | type,
|  | const GLvoid * | indices,
|  | GLsizei | primcount )

inline

References _glDrawElementsInstanced.

## glReadBuffer()

void osg::State::glReadBuffer | ( | GLenum | buffer | ) |

## haveAppliedAttribute() [1/4]

void osg::State::haveAppliedAttribute | ( | AttributeMap & | attributeMap,
|  | const StateAttribute * | attribute )

protected

## haveAppliedAttribute() [2/4]

void osg::State::haveAppliedAttribute | ( | AttributeMap & | attributeMap,
|  | StateAttribute::Type | type,
|  | unsigned int | member )

protected

## haveAppliedAttribute() [3/4]

void osg::State::haveAppliedAttribute | ( | const StateAttribute * | attribute | ) |

Attribute has been applied externally, update state to reflect this setting.

## haveAppliedAttribute() [4/4]

void osg::State::haveAppliedAttribute | ( | StateAttribute::Type | type,
|  | unsigned int | member = 0 )

Attribute has been applied externally, and therefore this attribute type has been dirtied and will need to be re-applied on next osg::State.apply(..). note, if you have an osg::StateAttribute which you have applied externally then use the have_applied(attribute) method as this will cause the osg::State to track the current state more accurately and enable lazy state updating such that only changed state will be applied.

## haveAppliedMode() [1/4]

void osg::State::haveAppliedMode | ( | ModeMap & | modeMap,
|  | StateAttribute::GLMode | mode )

protected

## haveAppliedMode() [2/4]

void osg::State::haveAppliedMode | ( | ModeMap & | modeMap,
|  | StateAttribute::GLMode | mode,
|  | StateAttribute::GLModeValue | value )

protected

## haveAppliedMode() [3/4]

void osg::State::haveAppliedMode | ( | StateAttribute::GLMode | mode | ) |

Mode has been set externally, therefore dirty the associated mode in osg::State so it is applied on next call to osg::State::apply(..)

## haveAppliedMode() [4/4]

void osg::State::haveAppliedMode | ( | StateAttribute::GLMode | mode,
|  | StateAttribute::GLModeValue | value )

Mode has been set externally, update state to reflect this setting.

## haveAppliedTextureAttribute() [1/2]

void osg::State::haveAppliedTextureAttribute | ( | unsigned int | unit,
|  | const StateAttribute * | attribute )

texture Attribute has been applied externally, update state to reflect this setting.

## haveAppliedTextureAttribute() [2/2]

void osg::State::haveAppliedTextureAttribute | ( | unsigned int | unit,
|  | StateAttribute::Type | type,
|  | unsigned int | member = 0 )

texture Attribute has been applied externally, and therefore this attribute type has been dirtied and will need to be re-applied on next osg::State.apply(..). note, if you have an osg::StateAttribute which you have applied externally then use the have_applied(attribute) method as this will the osg::State to track the current state more accurately and enable lazy state updating such that only changed state will be applied.

## haveAppliedTextureMode() [1/2]

void osg::State::haveAppliedTextureMode | ( | unsigned int | unit,
|  | StateAttribute::GLMode | mode )

texture Mode has been set externally, therefore dirty the associated mode in osg::State so it is applied on next call to osg::State::apply(..)

## haveAppliedTextureMode() [2/2]

void osg::State::haveAppliedTextureMode | ( | unsigned int | unit,
|  | StateAttribute::GLMode | mode,
|  | StateAttribute::GLModeValue | value )

texture Mode has been set externally, update state to reflect this setting.

## initializeExtensionProcs()

void osg::State::initializeExtensionProcs | ( |  | ) |

Initialize extension used by osg::State.

## insertStateSet()

void osg::State::insertStateSet | ( | unsigned int | pos,
|  | const StateSet * | dstate )

Insert stateset onto state stack.

## isFogCoordSupported()

bool osg::State::isFogCoordSupported | ( |  | ) | const

inline

References _isFogCoordSupported.

## isSecondaryColorSupported()

bool osg::State::isSecondaryColorSupported | ( |  | ) | const

inline

References _isSecondaryColorSupported.

## isVertexArrayObjectSupported()

bool osg::State::isVertexArrayObjectSupported | ( |  | ) | const

inline

References _isVertexArrayObjectSupported.

## isVertexBufferObjectSupported()

bool osg::State::isVertexBufferObjectSupported | ( |  | ) | const

inline

References _isVertexBufferObjectSupported.

## lazyDisablingOfVertexAttributes()

void osg::State::lazyDisablingOfVertexAttributes | ( |  | ) |

inline

References _vas.

## loadModelViewMatrix()

void osg::State::loadModelViewMatrix | ( |  | ) |

protected

## MultiTexCoord()

void osg::State::MultiTexCoord | ( | unsigned int | unit,
|  | float | x,
|  | float | y = 0.0f,
|  | float | z = 0.0f,
|  | float | w = 1.0f )

inline

References _glMultiTexCoord4f, _glVertexAttrib4f, _texCoordAliasList, _useVertexAttributeAliasing, and GL_TEXTURE0.

## Normal()

void osg::State::Normal | ( | float | x,
|  | float | y,
|  | float | z )

inline

References _glVertexAttrib4f, _normalAlias, and _useVertexAttributeAliasing.

## popAllStateSets()

void osg::State::popAllStateSets | ( |  | ) |

pop all statesets off state stack, ensuring it is empty ready for the next frame. Note, to return OpenGL to default state, one should do any state.popAllStatSets(); state.apply().

## popAttributeList()

void osg::State::popAttributeList | ( | AttributeMap & | attributeMap,
|  | const StateSet::AttributeList & | attributeList )

inline protected

References osg::State::AttributeStack::attributeVec, and osg::State::AttributeStack::changed.

## popDefineList()

void osg::State::popDefineList | ( | DefineMap & | uniformMap,
|  | const StateSet::DefineList & | defineList )

inline protected

References osg::State::DefineMap::changed, osg::State::DefineStack::changed, osg::State::DefineStack::defineVec, and osg::State::DefineMap::map.

## popModeList()

void osg::State::popModeList | ( | ModeMap & | modeMap,
|  | const StateSet::ModeList & | modeList )

inline protected

References osg::State::ModeStack::changed, and osg::State::ModeStack::valueVec.

## popStateSet()

void osg::State::popStateSet | ( |  | ) |

Pop stateset off state stack.

Referenced by osgUtil::StateGraph::moveStateGraph(), osgUtil::StateGraph::moveToRootStateGraph(), and popStateSetStackToSize().

## popStateSetStackToSize()

void osg::State::popStateSetStackToSize | ( | unsigned int | size | ) |

inline

Pop StateSet's for the StateSet stack till its size equals the specified size.

References _stateStateStack, and popStateSet().

## popUniformList()

void osg::State::popUniformList | ( | UniformMap & | uniformMap,
|  | const StateSet::UniformList & | uniformList )

inline protected

References osg::State::UniformStack::uniformVec.

## print()

void osg::State::print | ( | std::ostream & | fout | ) | const

print out the internal details of osg::State - useful for debugging.

## pushAttributeList()

void osg::State::pushAttributeList | ( | AttributeMap & | attributeMap,
|  | const StateSet::AttributeList & | attributeList )

inline protected

References osg::State::AttributeStack::attributeVec, osg::State::AttributeStack::changed, osg::StateAttribute::OVERRIDE, and osg::StateAttribute::PROTECTED.

## pushDefineList()

void osg::State::pushDefineList | ( | DefineMap & | defineMap,
|  | const StateSet::DefineList & | defineList )

inline protected

References osg::State::DefineMap::changed, osg::State::DefineStack::changed, osg::State::DefineStack::defineVec, osg::State::DefineMap::map, osg::StateAttribute::OVERRIDE, and osg::StateAttribute::PROTECTED.

## pushModeList()

void osg::State::pushModeList | ( | ModeMap & | modeMap,
|  | const StateSet::ModeList & | modeList )

inline protected

References osg::State::ModeStack::changed, osg::StateAttribute::OVERRIDE, osg::StateAttribute::PROTECTED, and osg::State::ModeStack::valueVec.

## pushStateSet()

void osg::State::pushStateSet | ( | const StateSet * | dstate | ) |

Push stateset onto state stack.

Referenced by osgUtil::StateGraph::moveStateGraph().

## pushUniformList()

void osg::State::pushUniformList | ( | UniformMap & | uniformMap,
|  | const StateSet::UniformList & | uniformList )

inline protected

References osg::StateAttribute::OVERRIDE, osg::StateAttribute::PROTECTED, and osg::State::UniformStack::uniformVec.

## releaseGLObjects()

void osg::State::releaseGLObjects | ( |  | ) |

Release all OpenGL objects associated cached by this osg::State object.

## removeStateSet()

void osg::State::removeStateSet | ( | unsigned int | pos | ) |

Pop stateset off state stack.

## reset()

void osg::State::reset | ( |  | ) |

reset the state object to an empty stack.

## resetCurrentVertexArrayStateOnMatch()

void osg::State::resetCurrentVertexArrayStateOnMatch | ( | VertexArrayState * | vas | ) |

inline

Reset the CurrentVertexArrayState/VertexArrayObject if it's value matches the specificied vas - use when deleting a vas.

References _currentVAO, _globalVertexArrayState, _vas, and osg::VertexArrayState::getVertexArrayObject().

## resetVertexAttributeAlias()

void osg::State::resetVertexAttributeAlias | ( | bool | compactAliasing = true,
|  | unsigned int | numTextureUnits = 8 )

Reset the vertex attribute aliasing to osg's default. This method needs to be called before render anything unless you really know what you're doing !

## set() [1/2]

template<>

void osg::State::set | ( | GLExtensions * | ptr | ) |

inline

References _glExtensions.

## set() [2/2]

template<typename T>

void osg::State::set | ( | T * | ptr | ) |

inline

Set a specific GL extensions object pr GraphicsObjectManager.

References _extensionMap.

## setAbortRenderingPtr()

void osg::State::setAbortRenderingPtr | ( | bool * | abortPtr | ) |

inline

Set flag for early termination of the draw traversal.

References _abortRenderingPtr.

## setActiveTextureUnit()

bool osg::State::setActiveTextureUnit | ( | unsigned int | unit | ) |

inline

Set the current texture unit, return true if selected, false if selection failed such as when multi texturing is not supported. note, only updates values that change.

References _currentActiveTextureUnit, _glActiveTexture, _glMaxTextureCoords, _glMaxTextureUnits, GL_TEXTURE0, and osg::maximum().

Referenced by applyAttributeOnTexUnit(), applyGlobalDefaultAttributeOnTexUnit(), and applyModeOnTexUnit().

## setAttributeBindingList()

void osg::State::setAttributeBindingList | ( | const Program::AttribBindingList & | attribBindingList | ) |

inline

Set the vertex attribute binding list. This method needs to be called before render anything unless you really know what you're doing !

References _attributeBindingList.

## setCheckForGLErrors()

void osg::State::setCheckForGLErrors | ( | CheckForGLErrors | check | ) |

inline

Set whether and how often OpenGL errors should be checked for.

References _checkGLErrors.

## setClientActiveTextureUnit()

bool osg::State::setClientActiveTextureUnit | ( | unsigned int | unit | ) |

Set the current tex coord array texture unit, return true if selected, false if selection failed such as when multi texturing is not supported. note, only updates values that change.

## setColorAlias()

void osg::State::setColorAlias | ( | const VertexAttribAlias & | alias | ) |

inline

Set the vertex attribute aliasing for "color". This method needs to be called before render anything unless you really know what you're doing !

References _colorAlias.

## setColorPointer() [1/2]

void osg::State::setColorPointer | ( | const Array * | array | ) |

inline

References _vas.

## setColorPointer() [2/2]

void osg::State::setColorPointer | ( | GLint | size,
|  | GLenum | type,
|  | GLsizei | stride,
|  | const GLvoid * | ptr,
|  | GLboolean | normalized = GL_TRUE )

inline

References _vas.

## setContextID()

void osg::State::setContextID | ( | unsigned int | contextID | ) |

inline

Set the current OpenGL context uniqueID. The ContextID is used by classes like osg::StateAttribute's and osg::Drawable's to help manage separate OpenGL objects, such as display lists, vertex buffer objects and texture object for each graphics context. The ContextID simply acts as an index into arrays that these classes maintain for the purpose of storing GL object handles.

Note, osgViewer::GraphicsWindow will automatically set up the ContextID for you, so you will rearely need to set this yourself.

The exception is when creating your own graphics context, where you should set the ContextID uniquely for each graphics context.

Typical settings for ContextID are 0,1,2,3... up to the maximum number of graphics contexts you have set up. By default contextID is 0.

References _contextID.

Referenced by osgViewer::GraphicsWindowEmbedded::init().

## setCurrentElementBufferObject()

void osg::State::setCurrentElementBufferObject | ( | osg::GLBufferObject * | ebo | ) |

inline

References _vas.

## setCurrentPixelBufferObject()

void osg::State::setCurrentPixelBufferObject | ( | osg::GLBufferObject * | pbo | ) |

inline

References _currentPBO.

## setCurrentToGlobalVertexArrayState()

void osg::State::setCurrentToGlobalVertexArrayState | ( |  | ) |

inline

Set the getCurrentVertexArrayState to the GlobalVertexArrayState.

References _globalVertexArrayState, and _vas.

## setCurrentVertexArrayObject()

void osg::State::setCurrentVertexArrayObject | ( | GLuint | vao | ) |

inline

References _currentVAO.

## setCurrentVertexArrayState()

void osg::State::setCurrentVertexArrayState | ( | VertexArrayState * | vas | ) |

inline

Set the CurrentVetexArrayState object that take which vertex arrays are bound.

References _vas.

## setCurrentVertexBufferObject()

void osg::State::setCurrentVertexBufferObject | ( | osg::GLBufferObject * | vbo | ) |

inline

References _vas.

## setDisplaySettings()

void osg::State::setDisplaySettings | ( | DisplaySettings * | vs | ) |

inline

Set the DisplaySettings. Note, nothing is applied, the visual settings are just used in the State object to pass the current visual settings to Drawables during rendering.

References _displaySettings.

## setDynamicObjectCount()

void osg::State::setDynamicObjectCount | ( | unsigned int | count,
|  | bool | callCallbackOnZero = false )

inline

Set the number of dynamic objects that will be rendered in this graphics context this frame.

References _completeDynamicObjectRenderingCallback, and _dynamicObjectCount.

## setDynamicObjectRenderingCompletedCallback()

void osg::State::setDynamicObjectRenderingCompletedCallback | ( | DynamicObjectRenderingCompletedCallback * | cb | ) |

inline

Set the callback to be called when the dynamic object count hits 0.

References _completeDynamicObjectRenderingCallback.

## setFogCoordAlias()

void osg::State::setFogCoordAlias | ( | const VertexAttribAlias & | alias | ) |

inline

Set the vertex attribute aliasing for "fog coord". This method needs to be called before render anything unless you really know what you're doing !

References _fogCoordAlias.

## setFogCoordPointer()

void osg::State::setFogCoordPointer | ( | const Array * | array | ) |

inline

References _vas.

## setFrameStamp()

void osg::State::setFrameStamp | ( | FrameStamp * | fs | ) |

inline

Set the frame stamp for the current frame.

References _frameStamp.

## setGlobalDefaultAttribute()

void osg::State::setGlobalDefaultAttribute | ( | const StateAttribute * | attribute | ) |

inline

References _attributeMap, osg::StateAttribute::getTypeMemberPair(), and osg::State::AttributeStack::global_default_attribute.

## setGlobalDefaultModeValue()

void osg::State::setGlobalDefaultModeValue | ( | StateAttribute::GLMode | mode,
|  | bool | enabled )

inline

References _modeMap, and osg::State::ModeStack::global_default_value.

## setGlobalDefaultTextureAttribute()

void osg::State::setGlobalDefaultTextureAttribute | ( | unsigned int | unit,
|  | const StateAttribute * | attribute )

inline

References getOrCreateTextureAttributeMap(), osg::StateAttribute::getTypeMemberPair(), and osg::State::AttributeStack::global_default_attribute.

## setGlobalDefaultTextureModeValue()

void osg::State::setGlobalDefaultTextureModeValue | ( | unsigned int | unit,
|  | StateAttribute::GLMode | mode,
|  | bool | enabled )

inline

References getOrCreateTextureModeMap(), and osg::State::ModeStack::global_default_value.

## setGpuTimestamp()

void osg::State::setGpuTimestamp | ( | Timer_t | tick,
|  | GLuint64 | timestamp )

inline

References _gpuTick, and _gpuTimestamp.

## setGraphicsContext()

void osg::State::setGraphicsContext | ( | GraphicsContext * | context | ) |

inline

Set the graphics context associated with that owns this State object.

References _graphicsContext.

Referenced by osgViewer::GraphicsWindowEmbedded::init().

## setGraphicsCostEstimator()

void osg::State::setGraphicsCostEstimator | ( | GraphicsCostEstimator * | gce | ) |

inline

Set the helper class that provides applications with estimate on how much different graphics operations will cost.

References _graphicsCostEstimator.

## setInitialViewMatrix()

void osg::State::setInitialViewMatrix | ( | const osg::RefMatrix * | matrix | ) |

## setInterleavedArrays()

void osg::State::setInterleavedArrays | ( | GLenum | format,
|  | GLsizei | stride,
|  | const GLvoid * | pointer )

inline

Wrapper around glInterleavedArrays(..). also resets the internal array points and modes within osg::State to keep the other vertex array operations consistent.

References _vas.

## setLastAppliedProgramObject()

void osg::State::setLastAppliedProgramObject | ( | const Program::PerContextProgram * | program | ) |

inline

References _lastAppliedProgramObject.

## setMaxBufferObjectPoolSize()

void osg::State::setMaxBufferObjectPoolSize | ( | unsigned int | size | ) |

## setMaxTexturePoolSize()

void osg::State::setMaxTexturePoolSize | ( | unsigned int | size | ) |

## setModeValidity()

void osg::State::setModeValidity | ( | StateAttribute::GLMode | mode,
|  | bool | valid )

inline

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.

References _modeMap, and osg::State::ModeStack::valid.

## setNormalAlias()

void osg::State::setNormalAlias | ( | const VertexAttribAlias & | alias | ) |

inline

Set the vertex attribute aliasing for "normal". This method needs to be called before render anything unless you really know what you're doing !

References _normalAlias.

## setNormalPointer() [1/2]

void osg::State::setNormalPointer | ( | const Array * | array | ) |

inline

References _vas.

## setNormalPointer() [2/2]

void osg::State::setNormalPointer | ( | GLenum | type,
|  | GLsizei | stride,
|  | const GLvoid * | ptr,
|  | GLboolean | normalized = GL_FALSE )

inline

References _vas.

## setSecondaryColorAlias()

void osg::State::setSecondaryColorAlias | ( | const VertexAttribAlias & | alias | ) |

inline

Set the vertex attribute aliasing for "secondary color". This method needs to be called before render anything unless you really know what you're doing !

References _secondaryColorAlias.

## setSecondaryColorPointer()

void osg::State::setSecondaryColorPointer | ( | const Array * | array | ) |

inline

References _vas.

## setShaderComposer()

void osg::State::setShaderComposer | ( | ShaderComposer * | sc | ) |

inline

deprecated.

References _shaderComposer.

## setShaderCompositionEnabled()

void osg::State::setShaderCompositionEnabled | ( | bool | flag | ) |

inline

References _shaderCompositionEnabled.

## setStartTick()

void osg::State::setStartTick | ( | Timer_t | tick | ) |

inline

References _startTick.

## setTexCoordAliasList()

void osg::State::setTexCoordAliasList | ( | const VertexAttribAliasList & | aliasList | ) |

inline

Set the vertex attribute aliasing list for texture coordinates. This method needs to be called before render anything unless you really know what you're doing !

References _texCoordAliasList.

## setTexCoordPointer() [1/2]

void osg::State::setTexCoordPointer | ( | unsigned int | unit,
|  | const Array * | array )

inline

References _vas.

## setTexCoordPointer() [2/2]

void osg::State::setTexCoordPointer | ( | unsigned int | unit,
|  | GLint | size,
|  | GLenum | type,
|  | GLsizei | stride,
|  | const GLvoid * | ptr,
|  | GLboolean | normalized = GL_FALSE )

inline

References _vas.

## setTimestampBits()

void osg::State::setTimestampBits | ( | int | bits | ) |

inline

References _timestampBits.

## setUpVertexAttribAlias()

void osg::State::setUpVertexAttribAlias | ( | VertexAttribAlias & | alias,
|  | GLuint | location,
|  | const std::string | glName,
|  | const std::string | osgName,
|  | const std::string & | declaration )

protected

## setUseModelViewAndProjectionUniforms()

void osg::State::setUseModelViewAndProjectionUniforms | ( | bool | flag | ) |

inline

References _useModelViewAndProjectionUniforms.

## setUseVertexAttributeAliasing()

void osg::State::setUseVertexAttributeAliasing | ( | bool | flag | ) |

## setVertexAlias()

void osg::State::setVertexAlias | ( | const VertexAttribAlias & | alias | ) |

inline

Set the vertex attribute aliasing for "vertex". This method needs to be called before render anything unless you really know what you're doing !

References _vertexAlias.

## setVertexAttribIPointer()

void osg::State::setVertexAttribIPointer | ( | unsigned int | unit,
|  | const Array * | array )

inline

References _vas.

## setVertexAttribLPointer()

void osg::State::setVertexAttribLPointer | ( | unsigned int | unit,
|  | const Array * | array )

inline

References _vas.

## setVertexAttribPointer()

void osg::State::setVertexAttribPointer | ( | unsigned int | unit,
|  | const Array * | array )

inline

References _vas.

## setVertexPointer() [1/2]

void osg::State::setVertexPointer | ( | const Array * | array | ) |

inline

Set the vertex pointer using an osg::Array, and manage any VBO that are required.

References _vas.

## setVertexPointer() [2/2]

void osg::State::setVertexPointer | ( | GLint | size,
|  | GLenum | type,
|  | GLsizei | stride,
|  | const GLvoid * | ptr,
|  | GLboolean | normalized = GL_FALSE )

inline

References _vas.

## supportsShaderRequirement()

bool osg::State::supportsShaderRequirement | ( | const std::string & | shaderRequirement | ) |

## supportsShaderRequirements()

bool osg::State::supportsShaderRequirements | ( | const osg::ShaderDefines & | shaderRequirements | ) |

## TexCoord()

void osg::State::TexCoord | ( | float | x,
|  | float | y = 0.0f,
|  | float | z = 0.0f,
|  | float | w = 1.0f )

inline

References _glVertexAttrib4f, _texCoordAliasList, and _useVertexAttributeAliasing.

## unbindDrawIndirectBufferObject()

void osg::State::unbindDrawIndirectBufferObject | ( |  | ) |

inline

References _currentDIBO, _glBindBuffer, and GL_DRAW_INDIRECT_BUFFER.

## unbindElementBufferObject()

void osg::State::unbindElementBufferObject | ( |  | ) |

inline

References _vas.

## unbindPixelBufferObject()

void osg::State::unbindPixelBufferObject | ( |  | ) |

inline

References _currentPBO, _glBindBuffer, and GL_PIXEL_UNPACK_BUFFER_ARB.

Referenced by bindPixelBufferObject().

## unbindVertexArrayObject()

void osg::State::unbindVertexArrayObject | ( |  | ) |

inline

References _currentVAO, and _glExtensions.

## unbindVertexBufferObject()

void osg::State::unbindVertexBufferObject | ( |  | ) |

inline

References _vas.

## updateModelViewAndProjectionMatrixUniforms()

void osg::State::updateModelViewAndProjectionMatrixUniforms | ( |  | ) |

## useVertexArrayObject()

bool osg::State::useVertexArrayObject | ( | bool | useVAO | ) | const

inline

References _forceVertexArrayObject, and _isVertexArrayObjectSupported.

Referenced by osg::Drawable::draw().

## useVertexBufferObject()

bool osg::State::useVertexBufferObject | ( | bool | useVBO | ) | const

inline

References _forceVertexBufferObject, and _isVertexBufferObjectSupported.

Referenced by osg::Drawable::draw().

## VerteAttrib()

void osg::State::VerteAttrib | ( | unsigned int | location,
|  | float | x,
|  | float | y = 0.0f,
|  | float | z = 0.0f,
|  | float | w = 0.0f )

inline

References _glVertexAttrib4f.

## Vertex()

void osg::State::Vertex | ( | float | x,
|  | float | y,
|  | float | z,
|  | float | w = 1.0f )

inline

References _glVertexAttrib4f, _useVertexAttributeAliasing, and _vertexAlias.

## Member Data Documentation

## _abortRenderingPtr

bool* osg::State::_abortRenderingPtr

protected

Referenced by getAbortRendering(), and setAbortRenderingPtr().

## _arrayDispatchers

AttributeDispatchers osg::State::_arrayDispatchers

protected

Referenced by getAttributeDispatchers().

## _attributeBindingList

Program::AttribBindingList osg::State::_attributeBindingList

protected

Referenced by getAttributeBindingList(), and setAttributeBindingList().

## _attributeMap

AttributeMap osg::State::_attributeMap

protected

Referenced by applyAttribute(), getAttributeMap(), getAttributeVec(), getGlobalDefaultAttribute(), and setGlobalDefaultAttribute().

## _checkGLErrors

CheckForGLErrors osg::State::_checkGLErrors

protected

Referenced by applyAttribute(), applyAttributeOnTexUnit(), applyGlobalDefaultAttribute(), applyGlobalDefaultAttributeOnTexUnit(), applyMode(), applyModeOnTexUnit(), getCheckForGLErrors(), and setCheckForGLErrors().

## _colorAlias

VertexAttribAlias osg::State::_colorAlias

protected

Referenced by Color(), getColorAlias(), and setColorAlias().

## _completeDynamicObjectRenderingCallback

osg::ref_ptr<DynamicObjectRenderingCompletedCallback> osg::State::_completeDynamicObjectRenderingCallback

protected

Referenced by decrementDynamicObjectCount(), getDynamicObjectRenderingCompletedCallback(), setDynamicObjectCount(), and setDynamicObjectRenderingCompletedCallback().

## _contextID

unsigned int osg::State::_contextID

protected

Referenced by get(), getContextID(), and setContextID().

## _currentActiveTextureUnit

unsigned int osg::State::_currentActiveTextureUnit

protected

Referenced by getActiveTextureUnit(), and setActiveTextureUnit().

## _currentClientActiveTextureUnit

unsigned int osg::State::_currentClientActiveTextureUnit

protected

## _currentDIBO

GLBufferObject* osg::State::_currentDIBO

protected

Referenced by bindDrawIndirectBufferObject(), and unbindDrawIndirectBufferObject().

## _currentPBO

GLBufferObject* osg::State::_currentPBO

protected

Referenced by bindPixelBufferObject(), getCurrentPixelBufferObject(), setCurrentPixelBufferObject(), and unbindPixelBufferObject().

## _currentShaderCompositionProgram

osg::Program* osg::State::_currentShaderCompositionProgram

protected

## _currentShaderCompositionUniformList

StateSet::UniformList osg::State::_currentShaderCompositionUniformList

protected

Referenced by applyShaderCompositionUniform(), and getCurrentShaderCompositionUniformList().

## _currentVAO

GLuint osg::State::_currentVAO

protected

Referenced by bindVertexArrayObject(), getCurrentVertexArrayObject(), resetCurrentVertexArrayStateOnMatch(), setCurrentVertexArrayObject(), and unbindVertexArrayObject().

## _defineMap

DefineMap osg::State::_defineMap

protected

Referenced by getDefineMap(), and getDefineMap().

## _displaySettings

ref_ptr<DisplaySettings> osg::State::_displaySettings

protected

Referenced by getActiveDisplaySettings(), getActiveDisplaySettings(), getDisplaySettings(), and setDisplaySettings().

## _drawBuffer

GLenum osg::State::_drawBuffer

protected

Referenced by getDrawBuffer().

## _dynamicObjectCount

unsigned int osg::State::_dynamicObjectCount

protected

Referenced by decrementDynamicObjectCount(), getDynamicObjectCount(), and setDynamicObjectCount().

## _extensionMap

ExtensionMap osg::State::_extensionMap

Referenced by get(), get(), and set().

## _extensionProcsInitialized

bool osg::State::_extensionProcsInitialized

protected

## _fogCoordAlias

VertexAttribAlias osg::State::_fogCoordAlias

protected

Referenced by getFogCoordAlias(), and setFogCoordAlias().

## _forceVertexArrayObject

bool osg::State::_forceVertexArrayObject

protected

Referenced by useVertexArrayObject().

## _forceVertexBufferObject

bool osg::State::_forceVertexBufferObject

protected

Referenced by useVertexBufferObject().

## _frameStamp

ref_ptr<FrameStamp> osg::State::_frameStamp

protected

Referenced by getFrameStamp(), getFrameStamp(), and setFrameStamp().

## _glActiveTexture

ActiveTextureProc osg::State::_glActiveTexture

protected

Referenced by setActiveTextureUnit().

## _glBindBuffer

BindBufferProc osg::State::_glBindBuffer

protected

Referenced by unbindDrawIndirectBufferObject(), and unbindPixelBufferObject().

## _glClientActiveTexture

ActiveTextureProc osg::State::_glClientActiveTexture

protected

## _glDisableVertexAttribArray

DisableVertexAttribProc osg::State::_glDisableVertexAttribArray

protected

## _glDrawArraysInstanced

DrawArraysInstancedProc osg::State::_glDrawArraysInstanced

protected

Referenced by glDrawArraysInstanced().

## _glDrawElementsInstanced

DrawElementsInstancedProc osg::State::_glDrawElementsInstanced

protected

Referenced by glDrawElementsInstanced().

## _glEnableVertexAttribArray

EnableVertexAttribProc osg::State::_glEnableVertexAttribArray

protected

## _glExtensions

osg::ref_ptr<GLExtensions> osg::State::_glExtensions

protected

Referenced by bindVertexArrayObject(), get(), get(), set(), and unbindVertexArrayObject().

## _glFogCoordPointer

FogCoordPointerProc osg::State::_glFogCoordPointer

protected

## _glMaxTextureCoords

GLint osg::State::_glMaxTextureCoords

protected

Referenced by getMaxTextureCoords(), and setActiveTextureUnit().

## _glMaxTextureUnits

GLint osg::State::_glMaxTextureUnits

protected

Referenced by getMaxTextureUnits(), and setActiveTextureUnit().

## _glMultiTexCoord4f

MultiTexCoord4fProc osg::State::_glMultiTexCoord4f

protected

Referenced by MultiTexCoord().

## _globalVertexArrayState

osg::ref_ptr<VertexArrayState> osg::State::_globalVertexArrayState

protected

Referenced by resetCurrentVertexArrayStateOnMatch(), and setCurrentToGlobalVertexArrayState().

## _glSecondaryColorPointer

SecondaryColorPointerProc osg::State::_glSecondaryColorPointer

protected

## _glVertexAttrib4f

VertexAttrib4fProc osg::State::_glVertexAttrib4f

protected

Referenced by Color(), MultiTexCoord(), Normal(), TexCoord(), VerteAttrib(), and Vertex().

## _glVertexAttrib4fv

VertexAttrib4fvProc osg::State::_glVertexAttrib4fv

protected

## _glVertexAttribIPointer

VertexAttribIPointerProc osg::State::_glVertexAttribIPointer

protected

## _glVertexAttribLPointer

VertexAttribLPointerProc osg::State::_glVertexAttribLPointer

protected

## _glVertexAttribPointer

VertexAttribPointerProc osg::State::_glVertexAttribPointer

protected

## _gpuTick

Timer_t osg::State::_gpuTick

protected

Referenced by getGpuTick(), getGpuTime(), and setGpuTimestamp().

## _gpuTimestamp

GLuint64 osg::State::_gpuTimestamp

protected

Referenced by getGpuTimestamp(), and setGpuTimestamp().

## _graphicsContext

GraphicsContext* osg::State::_graphicsContext

protected

Referenced by getGraphicsContext(), getGraphicsContext(), and setGraphicsContext().

## _graphicsCostEstimator

osg::ref_ptr<GraphicsCostEstimator> osg::State::_graphicsCostEstimator

protected

Referenced by getGraphicsCostEstimator(), getGraphicsCostEstimator(), and setGraphicsCostEstimator().

## _identity

ref_ptr<const RefMatrix> osg::State::_identity

protected

## _initialInverseViewMatrix

Matrix osg::State::_initialInverseViewMatrix

protected

Referenced by getInitialInverseViewMatrix().

## _initialViewMatrix

ref_ptr<const RefMatrix> osg::State::_initialViewMatrix

protected

Referenced by getInitialViewMatrix().

## _isFogCoordSupported

bool osg::State::_isFogCoordSupported

protected

Referenced by isFogCoordSupported().

## _isSecondaryColorSupported

bool osg::State::_isSecondaryColorSupported

protected

Referenced by isSecondaryColorSupported().

## _isVertexArrayObjectSupported

bool osg::State::_isVertexArrayObjectSupported

protected

Referenced by isVertexArrayObjectSupported(), and useVertexArrayObject().

## _isVertexBufferObjectSupported

bool osg::State::_isVertexBufferObjectSupported

protected

Referenced by isVertexBufferObjectSupported(), and useVertexBufferObject().

## _lastAppliedProgramObject

const Program::PerContextProgram* osg::State::_lastAppliedProgramObject

protected

Referenced by applyUniformList(), applyUniformMap(), getAttribLocation(), getLastAppliedProgramObject(), getUniformLocation(), getUniformLocation(), and setLastAppliedProgramObject().

## _maxBufferObjectPoolSize

unsigned int osg::State::_maxBufferObjectPoolSize

protected

Referenced by getMaxBufferObjectPoolSize().

## _maxTexturePoolSize

unsigned int osg::State::_maxTexturePoolSize

protected

Referenced by getMaxTexturePoolSize().

## _modelView

ref_ptr<const RefMatrix> osg::State::_modelView

protected

Referenced by getModelViewMatrix().

## _modelViewCache

ref_ptr<RefMatrix> osg::State::_modelViewCache

protected

## _modelViewMatrixUniform

ref_ptr<Uniform> osg::State::_modelViewMatrixUniform

protected

Referenced by getModelViewMatrixUniform().

## _modelViewProjectionMatrixUniform

ref_ptr<Uniform> osg::State::_modelViewProjectionMatrixUniform

protected

Referenced by getModelViewProjectionMatrixUniform().

## _modeMap

ModeMap osg::State::_modeMap

protected

Referenced by applyMode(), getGlobalDefaultModeValue(), getLastAppliedModeValue(), getModeMap(), getModeValidity(), setGlobalDefaultModeValue(), and setModeValidity().

## _normalAlias

VertexAttribAlias osg::State::_normalAlias

protected

Referenced by getNormalAlias(), Normal(), and setNormalAlias().

## _normalMatrixUniform

ref_ptr<Uniform> osg::State::_normalMatrixUniform

protected

Referenced by getNormalMatrixUniform().

## _projection

ref_ptr<const RefMatrix> osg::State::_projection

protected

Referenced by getProjectionMatrix().

## _projectionMatrixUniform

ref_ptr<Uniform> osg::State::_projectionMatrixUniform

protected

Referenced by getProjectionMatrixUniform().

## _quadIndicesGLuint

IndicesGLuint osg::State::_quadIndicesGLuint[4]

## _quadIndicesGLushort

IndicesGLushort osg::State::_quadIndicesGLushort[4]

## _readBuffer

GLenum osg::State::_readBuffer

protected

Referenced by getReadBuffer().

## _secondaryColorAlias

VertexAttribAlias osg::State::_secondaryColorAlias

protected

Referenced by getSecondaryColorAlias(), and setSecondaryColorAlias().

## _shaderComposer

osg::ref_ptr<ShaderComposer> osg::State::_shaderComposer

protected

Referenced by getShaderComposer(), getShaderComposer(), and setShaderComposer().

## _shaderCompositionDirty

bool osg::State::_shaderCompositionDirty

protected

Referenced by applyAttribute(), applyAttributeOnTexUnit(), applyGlobalDefaultAttribute(), and applyGlobalDefaultAttributeOnTexUnit().

## _shaderCompositionEnabled

bool osg::State::_shaderCompositionEnabled

protected

Referenced by getShaderCompositionEnabled(), and setShaderCompositionEnabled().

## _startTick

Timer_t osg::State::_startTick

protected

Referenced by getGpuTime(), getStartTick(), and setStartTick().

## _stateStateStack

StateSetStack osg::State::_stateStateStack

protected

Referenced by getStateSetStack(), getStateSetStackSize(), and popStateSetStackToSize().

## _texCoordAliasList

VertexAttribAliasList osg::State::_texCoordAliasList

protected

Referenced by getTexCoordAliasList(), MultiTexCoord(), setTexCoordAliasList(), and TexCoord().

## _textureAttributeMapList

TextureAttributeMapList osg::State::_textureAttributeMapList

protected

Referenced by getOrCreateTextureAttributeMap(), and getTextureAttributeMapList().

## _textureModeMapList

TextureModeMapList osg::State::_textureModeMapList

protected

Referenced by getOrCreateTextureModeMap(), and getTextureModeMapList().

## _timestampBits

int osg::State::_timestampBits

protected

Referenced by getTimestampBits(), and setTimestampBits().

## _uniformMap

UniformMap osg::State::_uniformMap

protected

Referenced by getUniformMap().

## _useModelViewAndProjectionUniforms

bool osg::State::_useModelViewAndProjectionUniforms

protected

Referenced by getUseModelViewAndProjectionUniforms(), and setUseModelViewAndProjectionUniforms().

## _useVertexAttributeAliasing

bool osg::State::_useVertexAttributeAliasing

protected

Referenced by Color(), getUseVertexAttributeAliasing(), MultiTexCoord(), Normal(), TexCoord(), and Vertex().

## _vas

VertexArrayState* osg::State::_vas

protected

Referenced by applyDisablingOfVertexAttributes(), bindElementBufferObject(), bindVertexBufferObject(), disableColorPointer(), disableFogCoordPointer(), disableNormalPointer(), disableSecondaryColorPointer(), disableTexCoordPointer(), disableTexCoordPointersAboveAndIncluding(), disableVertexAttribPointer(), disableVertexAttribPointersAboveAndIncluding(), disableVertexPointer(), getCurrentElementBufferObject(), getCurrentVertexArrayState(), getCurrentVertexBufferObject(), lazyDisablingOfVertexAttributes(), resetCurrentVertexArrayStateOnMatch(), setColorPointer(), setColorPointer(), setCurrentElementBufferObject(), setCurrentToGlobalVertexArrayState(), setCurrentVertexArrayState(), setCurrentVertexBufferObject(), setFogCoordPointer(), setInterleavedArrays(), setNormalPointer(), setNormalPointer(), setSecondaryColorPointer(), setTexCoordPointer(), setTexCoordPointer(), setVertexAttribIPointer(), setVertexAttribLPointer(), setVertexAttribPointer(), setVertexPointer(), setVertexPointer(), unbindElementBufferObject(), and unbindVertexBufferObject().

## _vertexAlias

VertexAttribAlias osg::State::_vertexAlias

protected

Referenced by getVertexAlias(), setVertexAlias(), and Vertex().

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

- State