|
openscenegraph
|
#include <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 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) |
Additional Inherited Members | |
| Static Public Member Functions inherited from osg::Referenced | |
| static OpenThreads::Mutex * | getGlobalReferencedMutex () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| static DeleteHandler * | getDeleteHandler () |
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:
pushStateSet() and popStateSet()). Manipulating this stack of OpenGL states manually is seldom needed, since OSG does this in the most common situations.glGet*(), which typically stall the graphics pipeline (see, for instance, captureCurrentState() and getModelViewMatrix()).
|
protected |
| typedef std::map<StateAttribute::TypeMemberPair,AttributeStack> osg::State::AttributeMap |
| typedef std::pair<const StateAttribute*,StateAttribute::OverrideValue> osg::State::AttributePair |
| typedef std::vector<AttributePair> osg::State::AttributeVec |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| typedef std::map<const std::type_info*, osg::ref_ptr<osg::Referenced> > osg::State::ExtensionMap |
|
protected |
| typedef std::vector<GLuint> osg::State::IndicesGLuint |
| typedef std::vector<GLushort> osg::State::IndicesGLushort |
| typedef std::vector< ref_ptr<const Matrix> > osg::State::MatrixStack |
| typedef std::map<StateAttribute::GLMode,ModeStack> osg::State::ModeMap |
|
protected |
|
protected |
| typedef std::vector<const StateSet*> osg::State::StateSetStack |
| typedef std::vector<AttributeMap> osg::State::TextureAttributeMapList |
| typedef std::vector<ModeMap> osg::State::TextureModeMapList |
| typedef std::map<std::string, UniformStack> osg::State::UniformMap |
|
protected |
|
protected |
| typedef std::vector<VertexAttribAlias> osg::State::VertexAttribAliasList |
|
protected |
|
protected |
|
protected |
| osg::State::State | ( | ) |
|
protectedvirtual |
| void osg::State::apply | ( | ) |
| void osg::State::apply | ( | const StateSet * | dstate | ) |
Apply stateset.
|
inline |
Apply an attribute if required.
References _attributeMap, applyAttribute(), osg::State::AttributeStack::changed, and osg::StateAttribute::getTypeMemberPair().
Referenced by applyAttribute(), applyAttributeList(), and applyAttributeMap().
|
inlineprotected |
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.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
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().
|
inlineprotected |
|
inline |
References _vas.
|
inlineprotected |
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().
|
inlineprotected |
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().
|
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.
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().
|
inlineprotected |
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.
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.
|
inlineprotected |
|
inlineprotected |
| void osg::State::applyModelViewAndProjectionUniformsIfRequired | ( | ) |
| void osg::State::applyModelViewMatrix | ( | const osg::Matrix & | ) |
| void osg::State::applyModelViewMatrix | ( | const osg::RefMatrix * | matrix | ) |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
| void osg::State::applyProjectionMatrix | ( | const osg::RefMatrix * | matrix | ) |
| void osg::State::applyShaderComposition | ( | ) |
Apply any shader composed state.
|
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.
|
inline |
|
inline |
References applyModeOnTexUnit(), osg::State::ModeStack::changed, and getOrCreateTextureModeMap().
|
inlineprotected |
|
inlineprotected |
References _lastAppliedProgramObject, and osg::State::UniformStack::uniformVec.
|
inline |
|
inline |
References _vas.
|
inline |
|
inline |
References bindVertexArrayObject(), and osg::VertexArrayState::getVertexArrayObject().
Referenced by bindVertexArrayObject(), and osg::Drawable::draw().
|
inline |
References _currentVAO, and _glExtensions.
|
inline |
References _vas.
| void osg::State::captureCurrentState | ( | StateSet & | stateset | ) | const |
Copy the modes and attributes which capture the current state.
| bool osg::State::checkGLErrors | ( | const char * | str1 = 0, |
| const char * | str2 = 0 ) const |
| bool osg::State::checkGLErrors | ( | const StateAttribute * | attribute | ) | const |
| bool osg::State::checkGLErrors | ( | StateAttribute::GLMode | mode | ) | const |
|
inline |
References _colorAlias, _glVertexAttrib4f, and _useVertexAttributeAliasing.
| bool osg::State::convertVertexShaderSourceToOsgBuiltIns | ( | std::string & | source | ) | const |
|
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.
| void osg::State::dirtyAllAttributes | ( | ) |
Dirty the modes attributes previously applied in osg::State.
| void osg::State::dirtyAllModes | ( | ) |
Dirty the modes previously applied in osg::State.
| void osg::State::dirtyAllVertexArrays | ( | ) |
dirty the vertex, normal, color, tex coords, secondary color, fog coord and index arrays.
| void osg::State::disableAllVertexArrays | ( | ) |
disable the vertex, normal, color, tex coords, secondary color, fog coord and index arrays.
|
inline |
References _vas.
|
inline |
References _vas.
|
inline |
References _vas.
|
inline |
References _vas.
|
inline |
References _vas.
|
inline |
References _vas.
|
inline |
References _vas.
|
inline |
References _vas.
|
inline |
References _vas.
| void osg::State::drawQuads | ( | GLint | first, |
| GLsizei | count, | ||
| GLsizei | primCount = 0 ) |
|
virtual |
called by the GraphicsContext just before GraphicsContext::swapBuffersImplementation().
|
inline |
References _glExtensions.
|
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().
|
inline |
References _glExtensions.
|
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.
|
inline |
Get flag for early termination of the draw traversal, if true steps should be taken to complete rendering early.
References _abortRenderingPtr.
|
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().
|
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().
|
inline |
Get the current texture unit.
References _currentActiveTextureUnit.
|
inline |
References _lastAppliedProgramObject.
|
inline |
References _attributeBindingList.
|
inline |
Get the helper class for dispatching osg::Arrays as OpenGL attribute data.
References _arrayDispatchers.
|
inline |
References _attributeMap.
|
inline |
|
inline |
Get whether and how often OpenGL errors should be checked for.
References _checkGLErrors.
| unsigned int osg::State::getClientActiveTextureUnit | ( | ) | const |
Get the current tex coord array texture unit.
|
inline |
References _colorAlias.
|
inline |
Get the current OpenGL context unique ID.
References _contextID.
Referenced by osg::Texture2D::SubloadCallback::generateTextureObject().
|
inline |
References _vas.
|
inline |
References _currentPBO.
|
inline |
Get the unform list in which to inject any uniforms that StateAttribute::apply(State&) methods provide.
References _currentShaderCompositionUniformList.
|
inline |
References _currentVAO.
|
inline |
Get the CurrentVetexArrayState object that take which vertex arrays are bound.
References _vas.
Referenced by osg::Drawable::draw().
|
inline |
References _vas.
|
inline |
References getLastAppliedAttribute(), and osg::StateAttribute::VIEWPORT.
|
inline |
References _defineMap.
|
inline |
References _defineMap.
| std::string osg::State::getDefineString | ( | const osg::ShaderDefines & | shaderDefines | ) |
|
inline |
Get the const DisplaySettings
References _displaySettings.
|
inline |
References _drawBuffer.
|
inline |
Get the number of dynamic objects that will be rendered in this graphics context this frame.
References _dynamicObjectCount.
|
inline |
Get the callback to be called when the dynamic object count hits 0.
References _completeDynamicObjectRenderingCallback.
|
inline |
References _fogCoordAlias.
|
inline |
Get the frame stamp for the current frame.
References _frameStamp.
|
inline |
Get the const frame stamp for the current frame.
References _frameStamp.
|
inline |
References _attributeMap, and osg::State::AttributeStack::global_default_attribute.
|
inline |
References _modeMap.
|
inline |
|
inline |
References getOrCreateTextureModeMap(), and osg::State::ModeStack::global_default_value.
|
inline |
References _gpuTick, _startTick, osg::Timer::delta_s(), and osg::Timer::instance().
|
inline |
References _gpuTimestamp.
|
inline |
Get the graphics context associated with that owns this State object.
References _graphicsContext.
|
inline |
Get the const graphics context associated with that owns this State object.
References _graphicsContext.
|
inline |
Get the helper class that provides applications with estimate on how much different graphics operations will cost.
References _graphicsCostEstimator.
|
inline |
Get the cont helper class that provides applications with estimate on how much different graphics operations will cost.
References _graphicsCostEstimator.
|
inline |
References _initialInverseViewMatrix.
|
inline |
References _initialViewMatrix.
|
protected |
| 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().
|
protected |
| bool osg::State::getLastAppliedMode | ( | StateAttribute::GLMode | mode | ) | const |
Get whether the current specified mode is enabled (true) or disabled (false).
|
inline |
References _modeMap.
|
inline |
References _lastAppliedProgramObject.
| 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.
| bool osg::State::getLastAppliedTextureMode | ( | unsigned int | unit, |
| StateAttribute::GLMode | mode ) const |
Get whether the current specified texture mode is enabled (true) or disabled (false).
|
inline |
References getOrCreateTextureModeMap(), and osg::State::ModeStack::last_applied_value.
|
inline |
References _maxBufferObjectPoolSize.
|
inline |
For GL>=2.0 uses GL_MAX_TEXTURE_COORDS, for GL<2 uses GL_MAX_TEXTURE_UNITS.
References _glMaxTextureCoords.
|
inline |
References _maxTexturePoolSize.
Referenced by osg::Texture::isSafeToUnrefImageData().
|
inline |
For GL>=2.0 uses GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, for GL<2 uses GL_MAX_TEXTURE_UNITS.
References _glMaxTextureUnits.
|
inline |
References _modelView.
|
inline |
References _modelViewMatrixUniform.
|
inline |
References _modelViewProjectionMatrixUniform.
|
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.
|
inline |
References _normalAlias.
|
inline |
References _normalMatrixUniform.
|
inlineprotected |
References _textureAttributeMapList.
Referenced by applyTextureAttribute(), getGlobalDefaultTextureAttribute(), and setGlobalDefaultTextureAttribute().
|
inlineprotected |
References _textureModeMapList.
Referenced by applyTextureMode(), getGlobalDefaultTextureModeValue(), getLastAppliedTextureModeValue(), and setGlobalDefaultTextureModeValue().
|
inline |
References _projection.
|
inline |
References _projectionMatrixUniform.
|
inline |
References _readBuffer.
|
inline |
References _secondaryColorAlias.
|
inline |
deprecated.
References _shaderComposer.
|
inline |
deprecated.
References _shaderComposer.
|
inline |
References _shaderCompositionEnabled.
|
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.
|
inline |
Get the StateSet stack.
References _stateStateStack.
|
inline |
Get the number of StateSet's on the StateSet stack.
References _stateStateStack.
|
inline |
References _texCoordAliasList.
|
inline |
References _textureAttributeMapList.
|
inline |
References _textureModeMapList.
|
inline |
References _timestampBits.
|
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.
|
inline |
References _lastAppliedProgramObject.
|
inline |
References _uniformMap.
|
inline |
References _useModelViewAndProjectionUniforms.
|
inline |
References _useVertexAttributeAliasing.
|
inline |
References _vertexAlias.
| Polytope osg::State::getViewFrustum | ( | ) | const |
|
inline |
References _glDrawArraysInstanced.
| void osg::State::glDrawBuffer | ( | GLenum | buffer | ) |
|
inline |
References _glDrawElementsInstanced.
| void osg::State::glReadBuffer | ( | GLenum | buffer | ) |
|
protected |
|
protected |
| void osg::State::haveAppliedAttribute | ( | const StateAttribute * | attribute | ) |
Attribute has been applied externally, update state to reflect this setting.
| 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.
|
protected |
|
protected |
| 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(..)
| void osg::State::haveAppliedMode | ( | StateAttribute::GLMode | mode, |
| StateAttribute::GLModeValue | value ) |
Mode has been set externally, update state to reflect this setting.
| void osg::State::haveAppliedTextureAttribute | ( | unsigned int | unit, |
| const StateAttribute * | attribute ) |
texture Attribute has been applied externally, update state to reflect this setting.
| 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.
| 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(..)
| 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.
| void osg::State::initializeExtensionProcs | ( | ) |
Initialize extension used by osg::State.
| void osg::State::insertStateSet | ( | unsigned int | pos, |
| const StateSet * | dstate ) |
Insert stateset onto state stack.
|
inline |
References _isFogCoordSupported.
|
inline |
References _isSecondaryColorSupported.
|
inline |
References _isVertexArrayObjectSupported.
|
inline |
References _isVertexBufferObjectSupported.
|
inline |
References _vas.
|
protected |
|
inline |
References _glMultiTexCoord4f, _glVertexAttrib4f, _texCoordAliasList, _useVertexAttributeAliasing, and GL_TEXTURE0.
|
inline |
References _glVertexAttrib4f, _normalAlias, and _useVertexAttributeAliasing.
| 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().
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
References osg::State::ModeStack::changed, and osg::State::ModeStack::valueVec.
| void osg::State::popStateSet | ( | ) |
Pop stateset off state stack.
Referenced by osgUtil::StateGraph::moveStateGraph(), osgUtil::StateGraph::moveToRootStateGraph(), and popStateSetStackToSize().
|
inline |
Pop StateSet's for the StateSet stack till its size equals the specified size.
References _stateStateStack, and popStateSet().
|
inlineprotected |
References osg::State::UniformStack::uniformVec.
| void osg::State::print | ( | std::ostream & | fout | ) | const |
print out the internal details of osg::State - useful for debugging.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
| void osg::State::pushStateSet | ( | const StateSet * | dstate | ) |
Push stateset onto state stack.
Referenced by osgUtil::StateGraph::moveStateGraph().
|
inlineprotected |
| void osg::State::releaseGLObjects | ( | ) |
Release all OpenGL objects associated cached by this osg::State object.
| void osg::State::removeStateSet | ( | unsigned int | pos | ) |
Pop stateset off state stack.
| void osg::State::reset | ( | ) |
reset the state object to an empty stack.
|
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().
| 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 !
|
inline |
References _glExtensions.
|
inline |
Set a specific GL extensions object pr GraphicsObjectManager.
References _extensionMap.
|
inline |
Set flag for early termination of the draw traversal.
References _abortRenderingPtr.
|
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().
|
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.
|
inline |
Set whether and how often OpenGL errors should be checked for.
References _checkGLErrors.
| 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.
|
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.
|
inline |
References _vas.
|
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().
|
inline |
References _vas.
|
inline |
References _currentPBO.
|
inline |
Set the getCurrentVertexArrayState to the GlobalVertexArrayState.
References _globalVertexArrayState, and _vas.
|
inline |
References _currentVAO.
|
inline |
Set the CurrentVetexArrayState object that take which vertex arrays are bound.
References _vas.
|
inline |
References _vas.
|
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.
|
inline |
Set the number of dynamic objects that will be rendered in this graphics context this frame.
References _completeDynamicObjectRenderingCallback, and _dynamicObjectCount.
|
inline |
Set the callback to be called when the dynamic object count hits 0.
References _completeDynamicObjectRenderingCallback.
|
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.
|
inline |
Set the frame stamp for the current frame.
References _frameStamp.
|
inline |
|
inline |
References _modeMap, and osg::State::ModeStack::global_default_value.
|
inline |
|
inline |
References getOrCreateTextureModeMap(), and osg::State::ModeStack::global_default_value.
|
inline |
References _gpuTick, and _gpuTimestamp.
|
inline |
Set the graphics context associated with that owns this State object.
References _graphicsContext.
Referenced by osgViewer::GraphicsWindowEmbedded::init().
|
inline |
Set the helper class that provides applications with estimate on how much different graphics operations will cost.
References _graphicsCostEstimator.
| void osg::State::setInitialViewMatrix | ( | const osg::RefMatrix * | matrix | ) |
|
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.
|
inline |
References _lastAppliedProgramObject.
| void osg::State::setMaxBufferObjectPoolSize | ( | unsigned int | size | ) |
| void osg::State::setMaxTexturePoolSize | ( | unsigned int | size | ) |
|
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.
|
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.
|
inline |
References _vas.
|
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.
|
inline |
deprecated.
References _shaderComposer.
|
inline |
References _shaderCompositionEnabled.
|
inline |
References _startTick.
|
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.
|
inline |
References _vas.
|
inline |
References _vas.
|
inline |
References _timestampBits.
|
protected |
|
inline |
References _useModelViewAndProjectionUniforms.
| void osg::State::setUseVertexAttributeAliasing | ( | bool | flag | ) |
|
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.
|
inline |
References _vas.
|
inline |
References _vas.
|
inline |
References _vas.
|
inline |
Set the vertex pointer using an osg::Array, and manage any VBO that are required.
References _vas.
|
inline |
References _vas.
| bool osg::State::supportsShaderRequirement | ( | const std::string & | shaderRequirement | ) |
| bool osg::State::supportsShaderRequirements | ( | const osg::ShaderDefines & | shaderRequirements | ) |
|
inline |
References _glVertexAttrib4f, _texCoordAliasList, and _useVertexAttributeAliasing.
|
inline |
References _currentDIBO, _glBindBuffer, and GL_DRAW_INDIRECT_BUFFER.
|
inline |
References _vas.
|
inline |
References _currentPBO, _glBindBuffer, and GL_PIXEL_UNPACK_BUFFER_ARB.
Referenced by bindPixelBufferObject().
|
inline |
References _currentVAO, and _glExtensions.
|
inline |
References _vas.
| void osg::State::updateModelViewAndProjectionMatrixUniforms | ( | ) |
|
inline |
References _forceVertexArrayObject, and _isVertexArrayObjectSupported.
Referenced by osg::Drawable::draw().
|
inline |
References _forceVertexBufferObject, and _isVertexBufferObjectSupported.
Referenced by osg::Drawable::draw().
|
inline |
References _glVertexAttrib4f.
|
inline |
References _glVertexAttrib4f, _useVertexAttributeAliasing, and _vertexAlias.
|
protected |
Referenced by getAbortRendering(), and setAbortRenderingPtr().
|
protected |
Referenced by getAttributeDispatchers().
|
protected |
Referenced by getAttributeBindingList(), and setAttributeBindingList().
|
protected |
Referenced by applyAttribute(), getAttributeMap(), getAttributeVec(), getGlobalDefaultAttribute(), and setGlobalDefaultAttribute().
|
protected |
|
protected |
Referenced by Color(), getColorAlias(), and setColorAlias().
|
protected |
|
protected |
Referenced by get(), getContextID(), and setContextID().
|
protected |
Referenced by getActiveTextureUnit(), and setActiveTextureUnit().
|
protected |
|
protected |
Referenced by bindDrawIndirectBufferObject(), and unbindDrawIndirectBufferObject().
|
protected |
|
protected |
|
protected |
Referenced by applyShaderCompositionUniform(), and getCurrentShaderCompositionUniformList().
|
protected |
|
protected |
Referenced by getDefineMap(), and getDefineMap().
|
protected |
Referenced by getActiveDisplaySettings(), getActiveDisplaySettings(), getDisplaySettings(), and setDisplaySettings().
|
protected |
Referenced by getDrawBuffer().
|
protected |
Referenced by decrementDynamicObjectCount(), getDynamicObjectCount(), and setDynamicObjectCount().
| ExtensionMap osg::State::_extensionMap |
|
protected |
|
protected |
Referenced by getFogCoordAlias(), and setFogCoordAlias().
|
protected |
Referenced by useVertexArrayObject().
|
protected |
Referenced by useVertexBufferObject().
|
protected |
Referenced by getFrameStamp(), getFrameStamp(), and setFrameStamp().
|
protected |
Referenced by setActiveTextureUnit().
|
protected |
Referenced by unbindDrawIndirectBufferObject(), and unbindPixelBufferObject().
|
protected |
|
protected |
|
protected |
Referenced by glDrawArraysInstanced().
|
protected |
Referenced by glDrawElementsInstanced().
|
protected |
|
protected |
Referenced by bindVertexArrayObject(), get(), get(), set(), and unbindVertexArrayObject().
|
protected |
|
protected |
Referenced by getMaxTextureCoords(), and setActiveTextureUnit().
|
protected |
Referenced by getMaxTextureUnits(), and setActiveTextureUnit().
|
protected |
Referenced by MultiTexCoord().
|
protected |
Referenced by resetCurrentVertexArrayStateOnMatch(), and setCurrentToGlobalVertexArrayState().
|
protected |
|
protected |
Referenced by Color(), MultiTexCoord(), Normal(), TexCoord(), VerteAttrib(), and Vertex().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by getGpuTick(), getGpuTime(), and setGpuTimestamp().
|
protected |
Referenced by getGpuTimestamp(), and setGpuTimestamp().
|
protected |
Referenced by getGraphicsContext(), getGraphicsContext(), and setGraphicsContext().
|
protected |
Referenced by getGraphicsCostEstimator(), getGraphicsCostEstimator(), and setGraphicsCostEstimator().
|
protected |
Referenced by getInitialInverseViewMatrix().
Referenced by getInitialViewMatrix().
|
protected |
Referenced by isFogCoordSupported().
|
protected |
Referenced by isSecondaryColorSupported().
|
protected |
Referenced by isVertexArrayObjectSupported(), and useVertexArrayObject().
|
protected |
Referenced by isVertexBufferObjectSupported(), and useVertexBufferObject().
|
protected |
|
protected |
Referenced by getMaxBufferObjectPoolSize().
|
protected |
Referenced by getMaxTexturePoolSize().
Referenced by getModelViewMatrix().
Referenced by getModelViewMatrixUniform().
Referenced by getModelViewProjectionMatrixUniform().
|
protected |
|
protected |
Referenced by getNormalAlias(), Normal(), and setNormalAlias().
Referenced by getNormalMatrixUniform().
Referenced by getProjectionMatrix().
Referenced by getProjectionMatrixUniform().
| IndicesGLuint osg::State::_quadIndicesGLuint[4] |
| IndicesGLushort osg::State::_quadIndicesGLushort[4] |
|
protected |
Referenced by getReadBuffer().
|
protected |
Referenced by getSecondaryColorAlias(), and setSecondaryColorAlias().
|
protected |
Referenced by getShaderComposer(), getShaderComposer(), and setShaderComposer().
|
protected |
|
protected |
Referenced by getShaderCompositionEnabled(), and setShaderCompositionEnabled().
|
protected |
Referenced by getGpuTime(), getStartTick(), and setStartTick().
|
protected |
Referenced by getStateSetStack(), getStateSetStackSize(), and popStateSetStackToSize().
|
protected |
Referenced by getTexCoordAliasList(), MultiTexCoord(), setTexCoordAliasList(), and TexCoord().
|
protected |
Referenced by getOrCreateTextureAttributeMap(), and getTextureAttributeMapList().
|
protected |
Referenced by getOrCreateTextureModeMap(), and getTextureModeMapList().
|
protected |
Referenced by getTimestampBits(), and setTimestampBits().
|
protected |
Referenced by getUniformMap().
|
protected |
Referenced by getUseModelViewAndProjectionUniforms(), and setUseModelViewAndProjectionUniforms().
|
protected |
Referenced by Color(), getUseVertexAttributeAliasing(), MultiTexCoord(), Normal(), TexCoord(), and Vertex().
|
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().
|
protected |
Referenced by getVertexAlias(), setVertexAlias(), and Vertex().