State class for managing a state stack.
Inheritance:
Public Methods
-
State()
-
virtual ~State()
-
void pushStateSet(const StateSet* dstate)
- push stateset onto state stack
-
void popStateSet()
- pop drawstate off state stack
-
void captureCurrentState(StateSet& stateset) const
- copy the modes and attributes which captures the current state
-
void reset()
- reset the state object to an empty stack
-
inline void applyProjectionMatrix(const osg::Matrix* matrix)
-
const osg::Matrix& getProjectionMatrix() const
-
inline void applyModelViewMatrix(const osg::Matrix* matrix)
-
const osg::Matrix& getModelViewMatrix() const
-
Polytope getViewFrustum() const
-
void apply(const StateSet* dstate)
- Apply stateset
-
void apply()
- Apply the state
-
inline bool applyMode(StateAttribute::GLMode mode, bool enabled)
- Apply an OpenGL mode if required.
-
inline bool applyTextureMode(unsigned int unit, StateAttribute::GLMode mode, bool enabled)
-
inline bool applyAttribute(const StateAttribute* attribute)
- Apply an attribute if required.
-
inline bool applyTextureAttribute(unsigned int unit, const StateAttribute* attribute)
-
void haveAppliedMode(StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
- Mode has been set externally, update state to reflect this setting
-
void 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 haveAppliedAttribute(const StateAttribute* attribute)
- Attribute has been applied externally, update state to reflect this setting
-
void haveAppliedAttribute(StateAttribute::Type type)
- Attribute has been applied externally, and therefore this attribute type has been dirtied and will need to be re-appplied on next osg::Stateapply().
-
bool getLastAppliedMode(StateAttribute::GLMode mode) const
- Get whether the current specified mode is enabled (true) or disabled (false)
-
const StateAttribute* getLastAppliedAttribute(StateAttribute::Type type) const
- Get the current specified attribute, return NULL is one has not yet been applied
-
void haveAppliedTextureMode(unsigned int unit, StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
- texture Mode has been set externally, update state to reflect this setting
-
void 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 haveAppliedTextureAttribute(unsigned int unit, const StateAttribute* attribute)
- texture Attribute has been applied externally, update state to reflect this setting
-
void haveAppliedTextureAttribute(unsigned int unit, StateAttribute::Type type)
- texture Attribute has been applied externally, and therefore this attribute type has been dirtied and will need to be re-appplied on next osg::Stateapply().
-
bool getLastAppliedTextureMode(unsigned int unit, StateAttribute::GLMode mode) const
- Get whether the current specified texture mode is enabled (true) or disabled (false)
-
const StateAttribute* getLastAppliedTextureAttribute(unsigned int unit, StateAttribute::Type type) const
- Get the current specified texture attribute, return NULL is one has not yet been applied
-
void disableAllVertexArrays()
- disable the vertex, normal, color, tex coords, secenday color, fog coord and index arrays
-
void dirtyAllVertexArrays()
- dirty the vertex, normal, color, tex coords, secenday color, fog coord and index arrays
-
inline void setVertexPointer( GLint size, GLenum type, GLsizei stride, const GLvoid* ptr )
- wrapper around glEnableClientState(GL_VERTEX_ARRAY);glVertexPointer(); note, only updates values that change
-
inline void disableVertexPointer()
- wrapper glDisableClientState(GL_VERTEX_ARRAY).
-
inline void dirtyVertexPointer()
-
inline void setNormalPointer( GLenum type, GLsizei stride, const GLvoid* ptr )
- wrapper around glEnableClientState(GL_NORMAL_ARRAY);glNormalPointer(); note, only updates values that change
-
inline void disableNormalPointer()
- wrapper around glDisableClientState(GL_NORMAL_ARRAY); note, only updates values that change
-
inline void dirtyNormalPointer()
-
inline void setColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid* ptr )
- wrapper around glEnableClientState(GL_COLOR_ARRAY);glColorPointer(); note, only updates values that change
-
inline void disableColorPointer()
- wrapper around glDisableClientState(GL_COLOR_ARRAY); note, only updates values that change
-
inline void dirtyColorPointer()
-
inline bool isSecondaryColorSupported() const
-
void setSecondaryColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid* ptr )
- wrapper around glEnableClientState(GL_SECONDARY_COLOR_ARRAY);glSecondayColorPointer(); note, only updates values that change
-
inline void disableSecondaryColorPointer()
- wrapper around glDisableClientState(GL_SECONDARY_COLOR_ARRAY); note, only updates values that change
-
inline void dirtySecondaryColorPointer()
-
inline void setIndexPointer( GLenum type, GLsizei stride, const GLvoid* ptr )
- wrapper around glEnableClientState(GL_INDEX_ARRAY);glIndexPointer(); note, only updates values that change
-
inline void disableIndexPointer()
- wrapper around glDisableClientState(GL_INDEX_ARRAY); note, only updates values that change
-
inline void dirtyIndexPointer()
-
inline bool isFogCoordSupported() const
-
void setFogCoordPointer( GLenum type, GLsizei stride, const GLvoid* ptr )
- wrapper around glEnableClientState(GL_FOG_COORDINATE_ARRAY);glFogCoordPointer(); note, only updates values that change
-
inline void disableFogCoordPointer()
- wrapper around glDisableClientState(GL_FOG_COORDINATE_ARRAY); note, only updates values that change
-
inline void dirtyFogCoordPointer()
-
inline void setTexCoordPointer( unsigned int unit, GLint size, GLenum type, GLsizei stride, const GLvoid* ptr )
- wrapper around glEnableClientState(GL_TEXTURE_COORD_ARRAY);glTexCoordPointer(); note, only updates values that change
-
inline void disableTexCoordPointer( unsigned int unit )
- wrapper around glDisableClientState(GL_TEXTURE_COORD_ARRAY); note, only updates values that change
-
inline void dirtyTexCoordPointer( unsigned int unit )
-
inline void disableTexCoordPointersAboveAndIncluding( unsigned int unit )
-
inline void dirtyTexCoordPointersAboveAndIncluding( unsigned int unit )
-
bool setClientActiveTextureUnit( unsigned int unit )
- set the current tex coord array texture unit, return true if selected, false if selection failed such as when multitexturing is not supported.
-
bool setActiveTextureUnit( unsigned int unit )
- set the current texture unit, return true if selected, false if selection failed such as when multitexturing is not supported.
-
inline void setContextID(unsigned int contextID)
- Set the current OpenGL context uniqueID.
-
inline unsigned int getContextID() const
- Get the current OpenGL context unique ID
-
inline void setFrameStamp(FrameStamp* fs)
- Set the frame stamp for the current frame
-
inline const FrameStamp* getFrameStamp() const
- Set the frame stamp for the current frame
-
inline void setDisplaySettings(DisplaySettings* vs)
- Set the DisplaySettings.
-
inline const DisplaySettings* getDisplaySettings() const
- Get the DisplaySettings
-
inline void pushModeList(ModeMap& modeMap, const StateSet::ModeList& modeList)
-
inline void pushAttributeList(AttributeMap& attributeMap, const StateSet::AttributeList& attributeList)
-
inline void popModeList(ModeMap& modeMap, const StateSet::ModeList& modeList)
-
inline void popAttributeList(AttributeMap& attributeMap, const StateSet::AttributeList& attributeList)
-
inline void applyModeList(ModeMap& modeMap, const StateSet::ModeList& modeList)
-
inline void applyAttributeList(AttributeMap& attributeMap, const StateSet::AttributeList& attributeList)
-
inline void applyModeMap(ModeMap& modeMap)
-
inline void applyAttributeMap(AttributeMap& attributeMap)
Public Members
-
typedef std::pair<const StateAttribute*,StateAttribute::OverrideValue> AttributePair
-
typedef std::vector<AttributePair> AttributeVec
-
typedef std::vector<StateAttribute::GLModeValue> ValueVec
Public Methods
-
inline Referenced& operator = (Referenced&)
-
inline void ref() const
-
inline void unref() const
-
inline void unref_nodelete() const
-
inline int referenceCount() const
-
inline static int createdCount()
-
inline static int deletedCount()
Protected Fields
-
mutable int _refCount
-
static int _createdCount
-
static int _deletedCount
Documentation
State class for managing a state stack.
Lazy state updating is used to minimize state changes.
- State()
- virtual ~State()
- void pushStateSet(const StateSet* dstate)
- push stateset onto state stack
- void popStateSet()
- pop drawstate off state stack
- void captureCurrentState(StateSet& stateset) const
- copy the modes and attributes which captures the current state
- void reset()
- reset the state object to an empty stack
- inline void applyProjectionMatrix(const osg::Matrix* matrix)
- const osg::Matrix& getProjectionMatrix() const
- inline void applyModelViewMatrix(const osg::Matrix* matrix)
- const osg::Matrix& getModelViewMatrix() const
- Polytope getViewFrustum() const
- void apply(const StateSet* dstate)
- Apply stateset
- void apply()
- Apply the state
- inline bool applyMode(StateAttribute::GLMode mode, bool enabled)
- Apply an OpenGL mode if required.
- inline bool applyTextureMode(unsigned int unit, StateAttribute::GLMode mode, bool enabled)
- inline bool applyAttribute(const StateAttribute* attribute)
- Apply an attribute if required.
- inline bool applyTextureAttribute(unsigned int unit, const StateAttribute* attribute)
- void haveAppliedMode(StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
- Mode has been set externally, update state to reflect this setting
- void 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 haveAppliedAttribute(const StateAttribute* attribute)
- Attribute has been applied externally, update state to reflect this setting
- void haveAppliedAttribute(StateAttribute::Type type)
- Attribute has been applied externally,
and therefore this attribute type has been dirtied
and will need to be re-appplied on next osg::Stateapply().
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 accuratly and enable lazy state updating such
that only changed state will be applied.
- bool getLastAppliedMode(StateAttribute::GLMode mode) const
- Get whether the current specified mode is enabled (true) or disabled (false)
- const StateAttribute* getLastAppliedAttribute(StateAttribute::Type type) const
- Get the current specified attribute, return NULL is one has not yet been applied
- void haveAppliedTextureMode(unsigned int unit, StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
- texture Mode has been set externally, update state to reflect this setting
- void 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 haveAppliedTextureAttribute(unsigned int unit, const StateAttribute* attribute)
- texture Attribute has been applied externally, update state to reflect this setting
- void haveAppliedTextureAttribute(unsigned int unit, StateAttribute::Type type)
- texture Attribute has been applied externally,
and therefore this attribute type has been dirtied
and will need to be re-appplied on next osg::Stateapply().
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 accuratly and enable lazy state updating such
that only changed state will be applied.
- bool getLastAppliedTextureMode(unsigned int unit, StateAttribute::GLMode mode) const
- Get whether the current specified texture mode is enabled (true) or disabled (false)
- const StateAttribute* getLastAppliedTextureAttribute(unsigned int unit, StateAttribute::Type type) const
- Get the current specified texture attribute, return NULL is one has not yet been applied
- void disableAllVertexArrays()
- disable the vertex, normal, color, tex coords, secenday color, fog coord and index arrays
- void dirtyAllVertexArrays()
- dirty the vertex, normal, color, tex coords, secenday color, fog coord and index arrays
- inline void setVertexPointer( GLint size, GLenum type, GLsizei stride, const GLvoid* ptr )
- wrapper around glEnableClientState(GL_VERTEX_ARRAY);glVertexPointer();
note, only updates values that change
- inline void disableVertexPointer()
- wrapper glDisableClientState(GL_VERTEX_ARRAY).
note, only updates values that change.
- inline void dirtyVertexPointer()
- inline void setNormalPointer( GLenum type, GLsizei stride, const GLvoid* ptr )
- wrapper around glEnableClientState(GL_NORMAL_ARRAY);glNormalPointer();
note, only updates values that change
- inline void disableNormalPointer()
- wrapper around glDisableClientState(GL_NORMAL_ARRAY);
note, only updates values that change
- inline void dirtyNormalPointer()
- inline void setColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid* ptr )
- wrapper around glEnableClientState(GL_COLOR_ARRAY);glColorPointer();
note, only updates values that change
- inline void disableColorPointer()
- wrapper around glDisableClientState(GL_COLOR_ARRAY);
note, only updates values that change
- inline void dirtyColorPointer()
- inline bool isSecondaryColorSupported() const
- void setSecondaryColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid* ptr )
- wrapper around glEnableClientState(GL_SECONDARY_COLOR_ARRAY);glSecondayColorPointer();
note, only updates values that change
- inline void disableSecondaryColorPointer()
- wrapper around glDisableClientState(GL_SECONDARY_COLOR_ARRAY);
note, only updates values that change
- inline void dirtySecondaryColorPointer()
- inline void setIndexPointer( GLenum type, GLsizei stride, const GLvoid* ptr )
- wrapper around glEnableClientState(GL_INDEX_ARRAY);glIndexPointer();
note, only updates values that change
- inline void disableIndexPointer()
- wrapper around glDisableClientState(GL_INDEX_ARRAY);
note, only updates values that change
- inline void dirtyIndexPointer()
- inline bool isFogCoordSupported() const
- void setFogCoordPointer( GLenum type, GLsizei stride, const GLvoid* ptr )
- wrapper around glEnableClientState(GL_FOG_COORDINATE_ARRAY);glFogCoordPointer();
note, only updates values that change
- inline void disableFogCoordPointer()
- wrapper around glDisableClientState(GL_FOG_COORDINATE_ARRAY);
note, only updates values that change
- inline void dirtyFogCoordPointer()
- inline void setTexCoordPointer( unsigned int unit, GLint size, GLenum type, GLsizei stride, const GLvoid* ptr )
- wrapper around glEnableClientState(GL_TEXTURE_COORD_ARRAY);glTexCoordPointer();
note, only updates values that change
- inline void disableTexCoordPointer( unsigned int unit )
- wrapper around glDisableClientState(GL_TEXTURE_COORD_ARRAY);
note, only updates values that change
- inline void dirtyTexCoordPointer( unsigned int unit )
- inline void disableTexCoordPointersAboveAndIncluding( unsigned int unit )
- inline void dirtyTexCoordPointersAboveAndIncluding( unsigned int unit )
- bool setClientActiveTextureUnit( unsigned int unit )
- set the current tex coord array texture unit, return true if selected, false if selection failed such as when multitexturing is not supported.
note, only updates values that change.
- bool setActiveTextureUnit( unsigned int unit )
- set the current texture unit, return true if selected, false if selection failed such as when multitexturing is not supported.
note, only updates values that change.
- inline void setContextID(unsigned int contextID)
- Set the current OpenGL context uniqueID.
Note, it is the application developers responsibility to
set up unique ID for each OpenGL context. This value is
then used by osg::StateAttribure's and osg::Drawable's to
help manage OpenGL display list and texture binds appropriate
for each context, the contextID simply acts as an index local
arrays that they maintain for the purpose.
Typical settings for contextID are 0,1,2,3... up to the maximum
number of graphics contexts you have setup.
By default contextID is 0.
- inline unsigned int getContextID() const
- Get the current OpenGL context unique ID
- inline void setFrameStamp(FrameStamp* fs)
- Set the frame stamp for the current frame
- inline const FrameStamp* getFrameStamp() const
- Set the frame stamp for the current frame
- inline void setDisplaySettings(DisplaySettings* vs)
- Set the DisplaySettings. Note, nothing is applied, the visual settings are just used
used in the State object to pass the current visual settings to Drawables
during rendering.
- inline const DisplaySettings* getDisplaySettings() const
- Get the DisplaySettings
- typedef std::pair<const StateAttribute*,StateAttribute::OverrideValue> AttributePair
- typedef std::vector<AttributePair> AttributeVec
- typedef std::vector<StateAttribute::GLModeValue> ValueVec
- ModeStack()
- bool changed
- bool last_applied_value
- bool global_default_value
- ValueVec valueVec
- AttributeStack()
- bool changed
- apply an attribute if required, passing in attribute and appropriate attribute stack
- const StateAttribute* last_applied_attribute
- ref_ptr<StateAttribute> global_default_attribute
- AttributeVec attributeVec
- EnabledArrayPair()
- EnabledArrayPair(const EnabledArrayPair& eap)
- EnabledArrayPair& operator = (const EnabledArrayPair& eap)
- bool _dirty
- bool _enabled
- const GLvoid* _pointer
- inline void pushModeList(ModeMap& modeMap, const StateSet::ModeList& modeList)
- inline void pushAttributeList(AttributeMap& attributeMap, const StateSet::AttributeList& attributeList)
- inline void popModeList(ModeMap& modeMap, const StateSet::ModeList& modeList)
- inline void popAttributeList(AttributeMap& attributeMap, const StateSet::AttributeList& attributeList)
- inline void applyModeList(ModeMap& modeMap, const StateSet::ModeList& modeList)
- inline void applyAttributeList(AttributeMap& attributeMap, const StateSet::AttributeList& attributeList)
- inline void applyModeMap(ModeMap& modeMap)
- inline void applyAttributeMap(AttributeMap& attributeMap)
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.