IDirect3DDevice9::CreateStateBlock method (d3d9helper.h)

Creates a new state block that contains the values for all device states, vertex-related states, or pixel-related states.

Syntax

HRESULT CreateStateBlock(
  [in]          D3DSTATEBLOCKTYPE    Type,
  [out, retval] IDirect3DStateBlock9 **ppSB
);

Parameters

[in] Type

Type: D3DSTATEBLOCKTYPE

Type of state data that the method should capture. This parameter can be set to a value defined in the D3DSTATEBLOCKTYPE enumerated type.

[out, retval] ppSB

Type: IDirect3DStateBlock9**

Pointer to a state block interface. See IDirect3DStateBlock9.

Return value

Type: HRESULT

If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be one of the following: D3DERR_INVALIDCALL, D3DERR_OUTOFVIDEOMEMORY, E_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.

Differences between Direct3D 9 and Direct3D 10:

In Direct3D 9, a state block contains state data, for the states it was requested to capture, when the object is created. To change the value of the state block, call IDirect3DStateBlock9::Capture or IDirect3DDevice9::BeginStateBlock/IDirect3DDevice9::EndStateBlock. There is no state saved when a state block object is created in Direct3D 10.

Requirements

Requirement Value
Target Platform Windows
Header d3d9helper.h (include D3D9.h)
Library D3D9.lib

See also

IDirect3DDevice9

IDirect3DDevice9::BeginStateBlock

IDirect3DDevice9::EndStateBlock