DirectX SDK

Direct3DDevice7.ApplyStateBlock

The Direct3DDevice7.ApplyStateBlock method applies an existing device-state block to the rendering device.

object.ApplyStateBlock( _ 
    blockHandle As Long) 

Parameters

object
Object expression that resolves to a Direct3DDevice7 object.
blockHandle
Handle to the device state block to be applied, as returned by a previous call to the Direct3DDevice7.EndStateBlock method.

Error Codes

If the method fails, an error is raised and Err.Number may be set to DDERR_INVALIDPARAMS to indicate that the blockHandle parameter is invalid or a macro is currently being recorded.

Remarks

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

This method was introduced with the Direct3DDevice7 interface.

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

See Also

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