Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.ApplyStateBlock

Applies an existing device-state block to the rendering device.

object.ApplyStateBlock( _ 
    Token As Long)

Parts

object
Object expression that resolves to a Direct3DDevice8 object.
Token
Handle to the device-state block to execute, as returned by a previous call to the Direct3DDevice8.EndStateBlock method.

Error Codes

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

Err.Number may be set to D3DERR_INVALIDCALL to indicate that the Token parameter is invalid or a macro is currently being recorded.

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

Remarks

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

Applications cannot apply a device-state block while recording another block.

As with all operations that affect the state of the rendering device, it is recommended that you apply state blocks during scene rendering—that is, after calling the Direct3DDevice8.BeginScene method and before calling Direct3DDevice8.EndScene.

See Also

Direct3DDevice8.BeginStateBlock, Direct3DDevice8.EndStateBlock, Direct3DDevice8.CaptureStateBlock, Direct3DDevice8.CreateStateBlock, Direct3DDevice8.DeleteStateBlock