Home -> IStateContainer -> SetStateValue
Description
The SetStateValue method defines a new shader state value which will be effective under this node on the render tree. Like resource bindings, state values are implemented on the tree using a stack, so child nodes can override state values which are set at a higher level of the tree, without affecting sibling nodes.
Warning
If the application attempts to change a state value on a child IStateGroupNode or IRenderableNode which has had a constant state value set through SetConstantStateValue, the results are undefined. The new state value may be updated, or it might not, but in either case, no warnings or errors are likely to be raised for performance reasons. It is the responsibility of the application to ensure it does not attempt to override constant state values.
Usage
template<class T>
void SetStateValue(StateValueId stateId, const T& value);
template<class T, class... IndexTs>
void SetStateValue(StateValueId stateId, const T& value, size_t firstArrayIndex, IndexTs... additionalArrayIndices);
template<class T>
void SetStateValue(StateValueId stateId, const T& value, const size_t* arrayIndices, size_t arrayIndexCount);
Argument list
- value [StateValueId]
- The StateValueId of the target state variable
- value [T]
- The value to assign to the state variable
- firstArrayIndex [size_t]
- First array index when a variadic set of array indices are being supplied
- additionalArrayIndices [size_t]
- Additional array indices when a variadic set of array indices are being supplied
- arrayIndices [const size_t*]
- Pointer to a set of array indices to use for the target state value
- arrayIndexCount [size_t]
- The number of array indices to read from the arrayIndices member. The number of supplied indices must match the required number of indices for the target state value.