Microsoft DirectX 8.1 (Visual Basic) |
The Direct3DDevice8.CreateStateBlock method creates a new state block that contains the entire set of device states or only those device states related to vertex or pixel processing. The CreateStateBlock method accepts two parameters. The first parameter identifies the type of state information to capture in the new state block, and the second parameter is the address of a variable that will receive a valid state-block handle if the call succeeds.
Valid values for the first parameter are defined by the CONST_D3DSTATEBLOCKTYPE enumeration, which includes members that you can use to capture the entire set of device states (D3DSBT_ALL), or only those states that pertain to vertex or pixel processing (D3DSBT_VERTEXSTATE or D3DSBT_PIXELSTATE). The following list summarizes the states that the system captures when you pass the D3DSBT_VERTEXSTATE or D3DSBT_PIXELSTATE values.
Note It is important to check the error code from the CreateStateBlock method. If the method fails, it is likely because the display mode has changed. Your application should recover from this type of failure by recreating its surfaces, and then recreating the state block.