共用方式為


CD3DX12_DEPTH_STENCIL_DESC1 結構

協助程序結構,可讓您輕鬆初始化 D3D12_DEPTH_STENCIL_DESC1 結構。

語法

struct CD3DX12_DEPTH_STENCIL_DESC1  : public D3D12_DEPTH_STENCIL_DESC1{
  CD3DX12_DEPTH_STENCIL_DESC1 CD3DX12_DEPTH_STENCIL_DESC1();
  CD3DX12_DEPTH_STENCIL_DESC1 explicit CD3DX12_DEPTH_STENCIL_DESC1(const D3D12_DEPTH_STENCIL_DESC1& o);
  CD3DX12_DEPTH_STENCIL_DESC1 explicit CD3DX12_DEPTH_STENCIL_DESC1(const D3D12_DEPTH_STENCIL_DESC& o);
  CD3DX12_DEPTH_STENCIL_DESC1 explicit CD3DX12_DEPTH_STENCIL_DESC1(CD3DX12_DEFAULT);
  CD3DX12_DEPTH_STENCIL_DESC1 explicit CD3DX12_DEPTH_STENCIL_DESC1(BOOL depthEnable, D3D12_DEPTH_WRITE_MASK depthWriteMask, D3D12_COMPARISON_FUNC depthFunc, BOOL stencilEnable, UINT8 stencilReadMask, UINT8 stencilWriteMask, D3D12_STENCIL_OP frontStencilFailOp, D3D12_STENCIL_OP frontStencilDepthFailOp, D3D12_STENCIL_OP frontStencilPassOp, D3D12_COMPARISON_FUNC frontStencilFunc, D3D12_STENCIL_OP backStencilFailOp, D3D12_STENCIL_OP backStencilDepthFailOp, D3D12_STENCIL_OP backStencilPassOp, D3D12_COMPARISON_FUNC backStencilFunc, BOOL depthBoundsTestEnable);
                              ~CD3DX12_DEPTH_STENCIL_DESC1();
                              operator const D3D12_DEPTH_STENCIL_DESC1&() const;
                              operator const D3D12_DEPTH_STENCIL_DESC() const;
};

成員

CD3DX12_DEPTH_STENCIL_DESC1()

建立新的未初始化CD3DX12_DEPTH_STENCIL_DESC1實例。

explicit CD3DX12_DEPTH_STENCIL_DESC1(const D3D12_DEPTH_STENCIL_DESC1& o)

建立CD3DX12_DEPTH_STENCIL_DESC1的新實例,以從 D3D12_DEPTH_STENCIL_DESC1 結構複製的值初始化。

explicit CD3DX12_DEPTH_STENCIL_DESC1(const D3D12_DEPTH_STENCIL_DESC& o)

建立CD3DX12_DEPTH_STENCIL_DESC1的新實例,以從 D3D12_DEPTH_STENCIL_DESC 結構複製的值初始化

和其他 DepthBoundsTestEnable 成員設定為 FALSE

明確CD3DX12_DEPTH_STENCIL_DESC1(CD3DX12_DEFAULT)

建立CD3DX12_DEPTH_STENCIL_DESC1的新實例,以 D3DX12 規定的默認狀態初始化:

        DepthEnable = TRUE;
        DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL;
        DepthFunc = D3D12_COMPARISON_FUNC_LESS;
        StencilEnable = FALSE;
        StencilReadMask = D3D12_DEFAULT_STENCIL_READ_MASK;
        StencilWriteMask = D3D12_DEFAULT_STENCIL_WRITE_MASK;
        const D3D12_DEPTH_STENCILOP_DESC defaultStencilOp =
        { D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_COMPARISON_FUNC_ALWAYS };
        FrontFace = defaultStencilOp;
        BackFace = defaultStencilOp;
    DepthBoundsTestEnable = FALSE;
          

explicit CD3DX12_DEPTH_STENCIL_DESC1(BOOL depthEnable, D3D12_DEPTH_WRITE_MASK depthWriteMask, D3D12_COMPARISON_FUNC depthFunc, BOOL 樣板Enable, UINT8 樣板ReadMask, UINT8 樣板WriteMask, D3D12_STENCIL_OP frontStencilFailOp、D3D12_STENCIL_OP frontStencilDepthFailOp、D3D12_STENCIL_OP frontStencilPassOp、D3D12_COMPARISON_FUNC frontStencilFunc、D3D12_STENCIL_OP backStencilFailOp、D3D12_STENCIL_OP backStencilDepthFailOp、D3D12_STENCIL_OP backStencilPassOp、D3D12_COMPARISON_FUNC backStencilFunc,BOOL depthBoundsTestEnable)

建立CD3DX12_DEPTH_STENCIL_DESC1的新實例,以參數清單中傳遞的值初始化。

~CD3DX12_DEPTH_STENCIL_DESC1()

終結D3DX12_DEPTH_STENCIL_DESC1的實例。

operator const D3D12_DEPTH_STENCIL_DESC1&() const

隱含轉換成D3D12_DEPTH_STENCIL_DESC1結構。 因為D3D12_DEPTH_STENCIL_DESC1是CD3DX12_DEPTH_STENCIL_DESC1的基礎類型,因此物件只會以 const D3D12_DEPTH_STENCIL_DESC1本身的參考傳回。

operator const D3D12_DEPTH_STENCIL_DESC() const

隱含轉換成D3D12_DEPTH_STENCIL_DESC結構值。 由於D3D12_DEPTH_STENCIL_DESC不是CD3DX12_DEPTH_STENCIL_DESC1的基礎類型,因此會建立新的D3D12_DEPTH_STENCIL_DESC實例,並以傳值傳回。 請注意,D3D12_DEPTH_STENCIL_DESC不包含 DepthBoundsTestEnable 成員,因此此值會在轉換中遺失。

需求

需求
頁首
D3dx12.h

另請參閱

D3D12 的協助程序結構

D3D12_DEPTH_STENCIL_DESC1

D3D12_DEPTH_STENCIL_DESC