Home -> IStateGroupNode

Declaration

class IDefaultState : public IStateContainer;

Description

The IDefaultState interface provides a simple container for attached state and resource bindings, as defined by the IStateContainer interface. When an IProgramNode object is added to the render tree by calling AddChildNode, AddChildNodes, or SetChildNodes on an IRenderPassNode, an IDefaultState object can optionally be provided along with the node. This object can then provide an initial set of state settings and resource bindings that are used for all child IRenderableNode objects. These default values can still be overridden by different values provided on the contained IStateGroupNode or IRenderableNode objects, however where the default values have not been overridden, the values set here will apply.

Being able to define default state values and bindings for all content under a given IProgramNode is especially useful for per-view settings, such as window size, view, and projection matrices. When your per-view state is provided in this manner, it allows a limited form of node reuse on the render tree, where the same IProgramNode object can be added more than once with varying default state. This is sufficient for example to display the same scene content in multiple windows, where a distinct window size and camera position can be used for each one. In more complex cases, where only part of the content needs to be duplicated, or a different shader program is required, it may still be necessary to duplicate nodes on the tree. If it is acceptable to reuse the same shader program and customize the behaviour through state or binding changes however, this functionality may allow easy reuse of scene content without needing to duplicate sections of your render tree.

Members

Initialization methods

Name Description
Public member Delete
Schedules the object for deletion. After calling this method, the object will be destroyed after the current frame completes drawing.

Resource binding methods (Inherited from IStateContainer)

Name Description
Public member BindTextureWithCombinedSampler
Creates a texture resource binding with a combined image sampler for the current shader program
Public member BindTexture
Creates a texture resource binding for the current shader program
Public member UnbindTexture
Removes a previously established texture resource binding, with or without a combined image sampler.
Public member BindSampler
Creates a sampler resource binding for the current shader program
Public member UnbindSampler
Removes a previously established sampler binding for the current shader program
Public member BindStateBuffer
Creates a state buffer resource binding for the current shader program
Public member UnbindStateBuffer
Removes a previously established state buffer binding for the current shader program
Public member BindResourceArray
Creates a resource array binding for the current shader program
Public member UnbindResourceArray
Removes a previously established resource array binding for the current shader program

State value methods (Inherited from IStateContainer)

Name Description
Public member SetStateValue
Sets the current target shader state variable to the specified value for this node and any child nodes
Public member ResetStateValue
Restores the target shader state variable to its default or inherited value

See also