|
| State () |
|
void | setGraphicsContext (GraphicsContext *context) |
|
GraphicsContext * | getGraphicsContext () |
|
const GraphicsContext * | getGraphicsContext () const |
|
void | setContextID (unsigned int contextID) |
|
unsigned int | getContextID () 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 | 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) |
|
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) |
|
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 () |
|
virtual void | objectDeleted (void *object) |
|
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 |
|
GLuint64EXT | getGpuTimestamp () const |
|
void | setGpuTimestamp (Timer_t tick, GLuint64EXT timestamp) |
|
int | getTimestampBits () const |
|
void | setTimestampBits (int bits) |
|
virtual void | frameCompleted () |
|
| 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 |
|
| Observer () |
|
virtual | ~Observer () |
|
|
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 |
|
typedef std::set< const
Program::PerContextProgram * > | AppliedProgramObjectSet |
|
typedef std::vector
< EnabledArrayPair > | EnabledTexCoordArrayList |
|
typedef std::vector
< EnabledArrayPair > | EnabledVertexAttribArrayList |
|
typedef GLsizei | stride |
|
typedef GLsizei const GLvoid * | pointer |
|
typedef GLenum | type |
|
typedef GLenum GLsizei | stride |
|
typedef GLenum GLsizei const
GLvoid * | pointer |
|
typedef GLfloat | x |
|
typedef GLfloat GLfloat | y |
|
typedef GLfloat GLfloat GLfloat | z |
|
typedef GLfloat GLfloat
GLfloat 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 GLboolean | normalized |
|
typedef GLboolean GLsizei | stride |
|
typedef GLboolean GLsizei
const GLvoid * | pointer |
|
typedef GLsizei | stride |
|
typedef GLsizei const GLvoid * | pointer |
|
typedef GLsizei | stride |
|
typedef GLsizei const GLvoid * | pointer |
|
typedef 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) |
|
|
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 | popModeList (ModeMap &modeMap, const StateSet::ModeList &modeList) |
|
void | popAttributeList (AttributeMap &attributeMap, const StateSet::AttributeList &attributeList) |
|
void | popUniformList (UniformMap &uniformMap, const StateSet::UniformList &uniformList) |
|
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 | 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()
).