Platform SDK: DirectX

Direct3DDevice7.CreateStateBlock

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

object.CreateStateBlock( _ 
  d3dsbType As CONST_D3DSTATEBLOCKTYPE, _ 
  blockHandle As Long) 
 

Parameters

object
Object expression that resolves to a Direct3DDevice7 object.
d3dsbType
Type of state data that the method should capture. This can be one of the values defined in the CONST_D3DSTATEBLOCKTYPE enumeration.
blockHandle
Variable that will contain the state block handle if the method succeeds.

Error Codes

If the method fails, an error is raised and Err.Number may be set to one of the following error codes:

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.

See Also

Direct3DDevice7.ApplyStateBlock, Direct3DDevice7.BeginStateBlock, Direct3DDevice7.CaptureStateBlock, Direct3DDevice7.EndStateBlock, Direct3DDevice7.DeleteStateBlock, State Blocks