|
| 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 |
|
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 | setModeValidity (StateAttribute::GLMode mode, bool valid) |
|
bool | getModeValidity (StateAttribute::GLMode mode) |
|
void | setGlobalDefaultModeValue (StateAttribute::GLMode mode, bool enabled) |
|
bool | getGlobalDefaultModeValue (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) |
|
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 | disableAllVertexArrays () |
|
void | dirtyAllVertexArrays () |
|
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 () |
|
void | bindPixelBufferObject (osg::GLBufferObject *pbo) |
|
void | unbindPixelBufferObject () |
|
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 | lazyDisablingOfVertexAttributes () |
|
void | applyDisablingOfVertexAttributes () |
|
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 | dirtyVertexPointer () |
|
void | setNormalPointer (const Array *array) |
|
void | setNormalPointer (GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE) |
|
void | disableNormalPointer () |
|
void | dirtyNormalPointer () |
|
void | setColorPointer (const Array *array) |
|
void | setColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_TRUE) |
|
void | disableColorPointer () |
|
void | dirtyColorPointer () |
|
bool | isSecondaryColorSupported () const |
|
void | setSecondaryColorPointer (const Array *array) |
|
void | setSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_TRUE) |
|
void | disableSecondaryColorPointer () |
|
void | dirtySecondaryColorPointer () |
|
bool | isFogCoordSupported () const |
|
void | setFogCoordPointer (const Array *array) |
|
void | setFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized=GL_FALSE) |
|
void | disableFogCoordPointer () |
|
void | dirtyFogCoordPointer () |
|
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 | dirtyTexCoordPointer (unsigned int unit) |
|
void | disableTexCoordPointersAboveAndIncluding (unsigned int unit) |
|
void | dirtyTexCoordPointersAboveAndIncluding (unsigned int unit) |
|
GLint | getMaxTextureCoords () const |
| For GL>=2.0 uses GL_MAX_TEXTURE_COORDS, for GL<2 uses GL_MAX_TEXTURE_UNITS. More...
|
|
GLint | getMaxTextureUnits () const |
| For GL>=2.0 uses GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, for GL<2 uses GL_MAX_TEXTURE_UNITS. More...
|
|
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 | setVertexAttribPointer (unsigned int index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *ptr) |
|
void | setVertexAttribIPointer (unsigned int index, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) |
|
void | setVertexAttribLPointer (unsigned int index, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) |
|
void | disableVertexAttribPointer (unsigned int index) |
|
void | disableVertexAttribPointersAboveAndIncluding (unsigned int index) |
|
void | dirtyVertexAttribPointer (unsigned int index) |
|
void | dirtyVertexAttribPointersAboveAndIncluding (unsigned int index) |
|
bool | isVertexBufferObjectSupported () 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 |
|
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 *str) const |
|
bool | checkGLErrors (StateAttribute::GLMode mode) const |
|
bool | checkGLErrors (const StateAttribute *attribute) const |
|
void | print (std::ostream &fout) const |
|
void | initializeExtensionProcs () |
|
GLBeginEndAdapter & | getGLBeginEndAdapter () |
|
ArrayDispatchers & | getArrayDispatchers () |
|
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 |
|
| Referenced () |
|
| Referenced (bool threadSafeRefUnref) |
|
| Referenced (const Referenced &) |
|
Referenced & | operator= (const Referenced &) |
|
virtual void | setThreadSafeRefUnref (bool threadSafe) |
|
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 |
|
|
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 () |
|
bool | computeSecondaryColorSupported () const |
|
bool | computeFogCoordSupported () const |
|
bool | computeVertexBufferObjectSupported () const |
|
typedef | void (GL_APIENTRY *ActiveTextureProc)(GLenum texture) |
|
typedef | void (GL_APIENTRY *FogCoordPointerProc)(GLenum type |
|
typedef | void (GL_APIENTRY *SecondaryColorPointerProc)(GLint size |
|
typedef | void (GL_APIENTRY *MultiTexCoord4fProc)(GLenum target |
|
typedef | void (GL_APIENTRY *VertexAttribPointerProc)(unsigned int |
|
typedef | void (GL_APIENTRY *VertexAttribIPointerProc)(unsigned int |
|
typedef | void (GL_APIENTRY *VertexAttribLPointerProc)(unsigned int |
|
typedef | void (GL_APIENTRY *EnableVertexAttribProc)(unsigned int) |
|
typedef | void (GL_APIENTRY *DisableVertexAttribProc)(unsigned int) |
|
typedef | void (GL_APIENTRY *BindBufferProc)(GLenum target |
|
virtual | ~Referenced () |
|
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const |
|
void | deleteUsingDeleteHandler () const |
|
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()
).
Definition at line 116 of file State.h.