D3D10CreateStateBlock function

Create a state block.

Syntax


HRESULT D3D10CreateStateBlock(
  _In_   ID3D10Device *pDevice,
  _In_   D3D10_STATE_BLOCK_MASK *pStateBlockMask,
  _Out_  ID3D10StateBlock **ppStateBlock
);

Parameters

pDevice [in]

Type: ID3D10Device*

The device for which the state block will be created.

pStateBlockMask [in]

Type: D3D10_STATE_BLOCK_MASK*

Indicates which parts of the device state will be captured when calling ID3D10StateBlock::Capture and reapplied when calling ID3D10StateBlock::Apply. See remarks.

ppStateBlock [out]

Type: ID3D10StateBlock**

Address of a pointer to the buffer created (see ID3D10StateBlock Interface).

Return value

Type: HRESULT

This method returns one of the following Direct3D 10 Return Codes.

Remarks

A state block is a collection of device state, and is used for saving and restoring device state. Use a state-block mask to enable subsets of state for saving and restoring.

The D3D10_STATE_BLOCK_MASK structure can be filled manually or by using any of the D3D10StateBlockMaskXXX APIs. A state block mask can also be obtained by calling ID3D10EffectTechnique::ComputeStateBlockMask or ID3D10EffectPass::ComputeStateBlockMask.

Differences between Direct3D 9 and Direct3D 10:

In Direct3D 10, a state block object does not contain any valid information about the state of the device until ID3D10StateBlock::Capture is called. In Direct3D 9, state is saved in a state block object, when it is created.

 

Requirements

Header

D3D10Effect.h

Library

D3D10.lib

DLL

D3D10.dll

See also

Core Functions

 

 

Community Additions

ADD
Show:
© 2015 Microsoft