Saving All Device States with a StateBlock (Direct3D 9)
A state block can be used to capture all device states (see State Blocks Save and Restore State (Direct3D 9)). The following state elements are included in the device state:
- Vertex state (see Saving Vertex States With a StateBlock (Direct3D 9)).
- Pixel state (see Saving Pixel State With a StateBlock (Direct3D 9)).
- Each texture assigned to a sampler.
- Each vertex texture.
- Each displacement map texture.
- The current texture palette.
- For each vertex stream: a pointer to the vertex buffer, each argument from IDirect3DDevice9::SetStreamSource, and the divider (if any) from IDirect3DDevice9::SetStreamSourceFreq.
- A pointer to the index buffer.
- The viewport.
- The scissors rectangle.
- The world, view, and projection matrices.
- The texture transforms.
- The clipping planes (if any).
- The current material.
To capture all device states with a state block, specify D3DSBT_ALL when calling IDirect3DDevice9::CreateStateBlock.
Related topics