IDirect3DStateBlock9::Capture method (d3d9helper.h)
Capture the current value of states that are included in a stateblock.
Syntax
HRESULT Capture();
Return value
Type: HRESULT
If the method succeeds, the return value is D3D_OK. If the method fails because capture cannot be done while in record mode, the return value is D3DERR_INVALIDCALL.
Remarks
The Capture method captures current values for states within an existing state block. It does not capture the entire state of the device. For example:
IDirect3DStateBlock9* pStateBlock = NULL;
pd3dDevice->BeginStateBlock();
// Add the ZENABLE state to the stateblock
pd3dDevice->SetRenderState ( D3DRS_ZENABLE, D3DZB_TRUE );
pd3dDevice->EndStateBlock ( &pStateBlock );
// Change the current value that is stored in the state block
pd3dDevice->SetRenderState ( D3DRS_ZENABLE, D3DZB_FALSE );
pStateBlock->Capture();
pStateBlock->Release();
Creating an empty stateblock and calling the Capture method does nothing if no states have been set.
The Capture method will not capture information for lights that are explicitly or implicitly created after the stateblock is created.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | d3d9helper.h (include D3D9.h) |
Library | D3D9.lib |