DirectX SDK

IDirect3DDevice7::CreateStateBlock

The IDirect3DDevice7::CreateStateBlock method creates a new state block that contains the current values for all device states, vertex-related states, or pixel-related states.

HRESULT CreateStateBlock( 
  D3DSTATEBLOCKTYPE d3dsbType, 
  LPDWORD lpdwBlockHandle
); 
 

Parameters

d3dsbType
Type of state data that the method should capture. This parameter can be set to one of the values defined in the D3DSTATEBLOCKTYPE enumerated type.
lpdwBlockHandle
Address of a variable to contain the state block handle if the method succeeds.

Return Values

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be one of the following values:

D3DERR_INBEGINSTATEBLOCK
DDERR_INVALIDPARAMS
DDERR_OUTOFMEMORY

Remarks

Vertex-related device states typically refer to those states that affect how the system processes vertices. Pixel-related states generally refer to device states that affect how the system processes pixel or depth-buffer data during rasterization. Some states are contained in both groups. For information about the states in each group, see Creating Predefined State Blocks.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Version: Requires DirectX 7.0.
  Header: Declared in d3d.h.

See Also

IDirect3DDevice7::ApplyStateBlock, IDirect3DDevice7::BeginStateBlock, IDirect3DDevice7::CaptureStateBlock, IDirect3DDevice7::EndStateBlock, IDirect3DDevice7::DeleteStateBlock, State Blocks