Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.CreateStateBlock

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

object.CreateStateBlock( _ 
    BlockType As CONST_D3DSTATEBLOCKTYPE) As Long

Parts

object
Object expression that resolves to a Direct3DDevice8 object.
BlockType
Type of state data that the method should capture. This parameter can be set to a value defined in the CONST_D3DSTATEBLOCKTYPE enumeration.

Return Values

A Long value containing the state block handle if the method succeeds.

Error Codes

If the method fails, an error is raised and Err.Number can be set to one of the following values.

D3DERR_INVALIDCALL
D3DERR_OUTOFVIDEOMEMORY
E_OUTOFMEMORY

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

The value &hFFFFFFFF& is an invalid state block handle.

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.

See Also

Direct3DDevice8.ApplyStateBlock, Direct3DDevice8.BeginStateBlock, Direct3DDevice8.CaptureStateBlock, Direct3DDevice8.EndStateBlock, Direct3DDevice8.DeleteStateBlock