D3D10CreateStateBlock function (d3d10effect.h)

Create a state block.


HRESULT D3D10CreateStateBlock(
  [in]  ID3D10Device           *pDevice,
  [in]  D3D10_STATE_BLOCK_MASK *pStateBlockMask,
  [out] ID3D10StateBlock       **ppStateBlock


[in] pDevice

Type: ID3D10Device*

The device for which the state block will be created.

[in] pStateBlockMask


Indicates which parts of the device state will be captured when calling ID3D10StateBlock::Capture and reapplied when calling ID3D10StateBlock::Apply. See remarks.

[out] ppStateBlock

Type: ID3D10StateBlock**

Address of a pointer to the buffer created (see ID3D10StateBlock Interface).

Return value


This method returns one of the following Direct3D 10 Return Codes.


A state block is a collection of device state, and is used for saving and restoring device state. Use a state-block mask to enable subsets of state for saving and restoring.

The D3D10_STATE_BLOCK_MASK structure can be filled manually or by using any of the D3D10StateBlockMaskXXX APIs. A state block mask can also be obtained by calling ID3D10EffectTechnique::ComputeStateBlockMask or ID3D10EffectPass::ComputeStateBlockMask.

Differences between Direct3D 9 and Direct3D 10:

In Direct3D 10, a state block object does not contain any valid information about the state of the device until ID3D10StateBlock::Capture is called. In Direct3D 9, state is saved in a state block object, when it is created.


Target Platform Windows
Header d3d10effect.h
Library D3D10.lib
DLL D3D10.dll

See also

Core Functions

Effect Functions