class SG_EXPORT osg::State

State class for managing a state stack.

Inheritance:


Public Methods

[more] State()
[more]virtual ~State()
[more]void pushStateSet(const StateSet* dstate)
push stateset onto state stack
[more]void popStateSet()
pop drawstate off state stack
[more]void captureCurrentState(StateSet& stateset) const
copy the modes and attributes which captures the current state
[more]void reset()
reset the state object to an empty stack
[more]inline void applyProjectionMatrix(const osg::Matrix* matrix)
[more]const osg::Matrix& getProjectionMatrix() const
[more]inline void applyModelViewMatrix(const osg::Matrix* matrix)
[more]const osg::Matrix& getModelViewMatrix() const
[more]Polytope getViewFrustum() const
[more]void apply(const StateSet* dstate)
Apply stateset
[more]void apply()
Apply the state
[more]inline const bool applyMode(const StateAttribute::GLMode mode, const bool enabled)
Apply an OpenGL mode if required.
[more]inline const bool applyAttribute(const StateAttribute* attribute)
Apply an attribute if required.
[more]void haveAppliedMode(const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value)
Mode has been set externally, update state to reflect this setting
[more]void haveAppliedMode(const 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()
[more]void haveAppliedAttribute(const StateAttribute* attribute)
Attribute has been applied externally, update state to reflect this setting
[more]void haveAppliedAttribute(const 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().
[more]const bool getLastAppliedMode(const StateAttribute::GLMode mode) const
Get whether the current specified mode is enabled (true) or disabled (false)
[more]const StateAttribute* getLastAppliedAttribute(const StateAttribute::Type type) const
Get the current specified attribute, return NULL is one has not yet been applied
[more]inline void setContextID(unsigned int contextID)
Set the current OpenGL context uniqueID.
[more]inline const unsigned int getContextID() const
Get the current OpenGL context unique ID
[more]inline void setFrameStamp(FrameStamp* fs)
Set the frame stamp for the current frame
[more]inline const FrameStamp* getFrameStamp() const
Set the frame stamp for the current frame
[more]inline void setDisplaySettings(DisplaySettings* vs)
Set the DisplaySettings.
[more]inline const DisplaySettings* getDisplaySettings() const
Get the DisplaySettings


Inherited from Referenced:

Public Methods

oinline Referenced& operator = (Referenced&)
oinline void ref() const
oinline void unref() const
oinline void unref_nodelete() const
oinline const int referenceCount() const

Protected Fields

omutable int _refCount


Documentation

State class for managing a state stack. Lazy state updating is used to minimize state changes.
o State()

ovirtual ~State()

ovoid pushStateSet(const StateSet* dstate)
push stateset onto state stack

ovoid popStateSet()
pop drawstate off state stack

ovoid captureCurrentState(StateSet& stateset) const
copy the modes and attributes which captures the current state

ovoid reset()
reset the state object to an empty stack

oinline void applyProjectionMatrix(const osg::Matrix* matrix)

oconst osg::Matrix& getProjectionMatrix() const

oinline void applyModelViewMatrix(const osg::Matrix* matrix)

oconst osg::Matrix& getModelViewMatrix() const

oPolytope getViewFrustum() const

ovoid apply(const StateSet* dstate)
Apply stateset

ovoid apply()
Apply the state

oinline const bool applyMode(const StateAttribute::GLMode mode, const bool enabled)
Apply an OpenGL mode if required.

oinline const bool applyAttribute(const StateAttribute* attribute)
Apply an attribute if required.

ovoid haveAppliedMode(const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value)
Mode has been set externally, update state to reflect this setting

ovoid haveAppliedMode(const 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()

ovoid haveAppliedAttribute(const StateAttribute* attribute)
Attribute has been applied externally, update state to reflect this setting

ovoid haveAppliedAttribute(const 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.

oconst bool getLastAppliedMode(const StateAttribute::GLMode mode) const
Get whether the current specified mode is enabled (true) or disabled (false)

oconst StateAttribute* getLastAppliedAttribute(const StateAttribute::Type type) const
Get the current specified attribute, return NULL is one has not yet been applied

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

oinline const unsigned int getContextID() const
Get the current OpenGL context unique ID

oinline void setFrameStamp(FrameStamp* fs)
Set the frame stamp for the current frame

oinline const FrameStamp* getFrameStamp() const
Set the frame stamp for the current frame

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

oinline const DisplaySettings* getDisplaySettings() const
Get the DisplaySettings

o ModeStack()

obool changed

obool last_applied_value

obool global_default_value

oValueVec valueVec

o AttributeStack()

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

oconst StateAttribute* last_applied_attribute

oref_ptr<StateAttribute> global_default_attribute

oAttributeVec attributeVec


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.