Device.BeginStateBlock() Method (Microsoft.DirectX.Direct3D)
Signals Microsoft Direct3D to begin recording a device state block.
To ensure that all recorded states are valid, an application can call the Device.ValidateDevice method prior to calling this method.
The following properties and methods can be recorded in a state block, after calling Device.BeginStateBlock and before calling Device.EndStateBlock.
- ClipPlane.SetSingleArray
- ClipPlane.Plane
- Device.CurrentTexturePalette
- Device.VertexFormat
- Device.Indices
- Device.Material
- Device.NPatchMode
- Device.PixelShader
- Device.SetPixelShaderConstant
- Device.RenderState
- Device.SamplerState
- Device.ScissorRectangle
- Device.SetStreamSource
- Device.SetStreamSourceFrequency
- Device.SetTexture
- Device.TextureState
- Device.VertexDeclaration
- Device.VertexShader
- Device.SetVertexShaderConstant
- All of the Light properties that are committed.
- All of the parameters and methods in ClipPlane (except GetSingleArray).
- All of the ClipPlanes methods.
- All of the SamplerStateManager properties.
- All of the TextureStateManager properties.
- All of the Transforms properties.
- All of the RenderStateManager properties.
The ordering of state changes in a state block is not guaranteed. If the same state is specified multiple times in a state block, only the last value is used.
Exceptions
InvalidCallException The method call is invalid. For example, a parameter might contain an invalid value. OutOfVideoMemoryException Direct3D could not allocate sufficient memory to complete the call.