擷取 stateblock 中包含的狀態目前值。
Syntax
HRESULT Capture();
傳回值
類型: HRESULT
如果方法成功,傳回值會D3D_OK。 如果在記錄模式中無法完成擷取,則傳回值會D3DERR_INVALIDCALL。
備註
Capture 方法會擷取現有狀態區塊內狀態的目前值。 它不會擷取裝置的整個狀態。 例如:
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();
建立空的 stateblock,如果尚未設定任何狀態,則呼叫 Capture 方法不會執行任何動作。
Capture 方法不會擷取在建立 stateblock 之後明確或隱含建立之光線的資訊。
規格需求
| 需求 | 值 |
|---|---|
| 目標平台 | Windows |
| 標頭 | d3d9.h (包含 D3D9.h) |
| 程式庫 | D3D9.lib |