次の方法で共有


CD3D11_DEPTH_STENCIL_VIEW_DESC class

Represents a depth-stencil view and provides convenience methods for creating depth-stencil views.

Members

The CD3D11_DEPTH_STENCIL_VIEW_DESC class inherits from D3D11_DEPTH_STENCIL_VIEW_DESC. CD3D11_DEPTH_STENCIL_VIEW_DESC also has these types of members:

  • Constructors
  • Methods

Constructors

The CD3D11_DEPTH_STENCIL_VIEW_DESC class has these constructors.

Constructor Description
CD3D11_DEPTH_STENCIL_VIEW_DESC()

Instantiates a new instance of an uninitialized CD3D11_DEPTH_STENCIL_VIEW_DESC structure.

CD3D11_DEPTH_STENCIL_VIEW_DESC(D3D11_DEPTH_STENCIL_VIEW_DESC_values)(D3D11_DSV_DIMENSION,DXGI_FORMAT,UINT,UINT,UINT,UINT)

Instantiates a new instance of a CD3D11_DEPTH_STENCIL_VIEW_DESC structure that is initialized with D3D11_DEPTH_STENCIL_VIEW_DESC values.

CD3D11_DEPTH_STENCIL_VIEW_DESC(D3D11_DEPTH_STENCIL_VIEW_DESC_values2)(ID3D11Texture1D,D3D11_DSV_DIMENSION,DXGI_FORMAT,UINT,UINT,UINT,UINT)

Instantiates a new instance of a CD3D11_DEPTH_STENCIL_VIEW_DESC structure that is initialized with D3D11_TEX1D_DSV or D3D11_TEX1D_ARRAY_DSV values.

CD3D11_DEPTH_STENCIL_VIEW_DESC(D3D11_DEPTH_STENCIL_VIEW_DESC_values3)(ID3D11Texture2D,D3D11_DSV_DIMENSION,DXGI_FORMAT,UINT,UINT,UINT,UINT)

Instantiates a new instance of a CD3D11_DEPTH_STENCIL_VIEW_DESC structure that is initialized with 2D texture values.

 

Methods

The CD3D11_DEPTH_STENCIL_VIEW_DESC class has these methods.

Method Description
~CD3D11_DEPTH_STENCIL_VIEW_DESC()

Destroys an instance of a CD3D11_DEPTH_STENCIL_VIEW_DESC structure.

CD3D11_DEPTH_STENCIL_VIEW_DESC(D3D11_DEPTH_STENCIL_VIEW_DESC)(const &D3D11_DEPTH_STENCIL_VIEW_DESC)

Instantiates a new instance of a CD3D11_DEPTH_STENCIL_VIEW_DESC structure that is initialized with a D3D11_DEPTH_STENCIL_VIEW_DESC structure.

D3D11_DEPTH_STENCIL_VIEW_DESC()

This operator returns the address of a D3D11_DEPTH_STENCIL_VIEW_DESC structure that contains the data from the CD3D11_DEPTH_STENCIL_VIEW_DESC instance.

 

Remarks

Here is how D3D11.h defines CD3D11_DEPTH_STENCIL_VIEW_DESC:


struct CD3D11_DEPTH_STENCIL_VIEW_DESC : public D3D11_DEPTH_STENCIL_VIEW_DESC
{
    CD3D11_DEPTH_STENCIL_VIEW_DESC()
    {}
    explicit CD3D11_DEPTH_STENCIL_VIEW_DESC( const D3D11_DEPTH_STENCIL_VIEW_DESC& o ) :
        D3D11_DEPTH_STENCIL_VIEW_DESC( o )
    {}
    explicit CD3D11_DEPTH_STENCIL_VIEW_DESC(
        D3D11_DSV_DIMENSION viewDimension,
        DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
        UINT mipSlice = 0,
        UINT firstArraySlice = 0,
        UINT arraySize = -1,
        UINT flags = 0 )
    {
        Format = format;
        ViewDimension = viewDimension;
        Flags = flags;
        switch (viewDimension)
        {
        case D3D11_DSV_DIMENSION_TEXTURE1D:
            Texture1D.MipSlice = mipSlice;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE1DARRAY:
            Texture1DArray.MipSlice = mipSlice;
            Texture1DArray.FirstArraySlice = firstArraySlice;
            Texture1DArray.ArraySize = arraySize;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2D:
            Texture2D.MipSlice = mipSlice;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DARRAY:
            Texture2DArray.MipSlice = mipSlice;
            Texture2DArray.FirstArraySlice = firstArraySlice;
            Texture2DArray.ArraySize = arraySize;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DMS:
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY:
            Texture2DMSArray.FirstArraySlice = firstArraySlice;
            Texture2DMSArray.ArraySize = arraySize;
            break;
        default: break;
        }
    }
    explicit CD3D11_DEPTH_STENCIL_VIEW_DESC(
        _In_ ID3D11Texture1D* pTex1D,
        D3D11_DSV_DIMENSION viewDimension,
        DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
        UINT mipSlice = 0,
        UINT firstArraySlice = 0,
        UINT arraySize = -1,
        UINT flags = 0 )
    {
        ViewDimension = viewDimension;
        Flags = flags;
        if (DXGI_FORMAT_UNKNOWN == format ||
            (-1 == arraySize && D3D11_DSV_DIMENSION_TEXTURE1DARRAY == viewDimension))
        {
            D3D11_TEXTURE1D_DESC TexDesc;
            pTex1D->GetDesc( &TexDesc );
            if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
            if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        Format = format;
        switch (viewDimension)
        {
        case D3D11_DSV_DIMENSION_TEXTURE1D:
            Texture1D.MipSlice = mipSlice;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE1DARRAY:
            Texture1DArray.MipSlice = mipSlice;
            Texture1DArray.FirstArraySlice = firstArraySlice;
            Texture1DArray.ArraySize = arraySize;
            break;
        default: break;
        }
    }
    explicit CD3D11_DEPTH_STENCIL_VIEW_DESC(
        _In_ ID3D11Texture2D* pTex2D,
        D3D11_DSV_DIMENSION viewDimension,
        DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
        UINT mipSlice = 0,
        UINT firstArraySlice = 0,
        UINT arraySize = -1,
        UINT flags = 0 )
    {
        ViewDimension = viewDimension;
        Flags = flags;
        if (DXGI_FORMAT_UNKNOWN == format || 
            (-1 == arraySize &&
                (D3D11_DSV_DIMENSION_TEXTURE2DARRAY == viewDimension ||
                D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY == viewDimension)))
        {
            D3D11_TEXTURE2D_DESC TexDesc;
            pTex2D->GetDesc( &TexDesc );
            if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
            if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        Format = format;
        switch (viewDimension)
        {
        case D3D11_DSV_DIMENSION_TEXTURE2D:
            Texture2D.MipSlice = mipSlice;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DARRAY:
            Texture2DArray.MipSlice = mipSlice;
            Texture2DArray.FirstArraySlice = firstArraySlice;
            Texture2DArray.ArraySize = arraySize;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DMS:
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY:
            Texture2DMSArray.FirstArraySlice = firstArraySlice;
            Texture2DMSArray.ArraySize = arraySize;
            break;
        default: break;
        }
    }
    ~CD3D11_DEPTH_STENCIL_VIEW_DESC() {}
    operator const D3D11_DEPTH_STENCIL_VIEW_DESC&() const { return *this; }
};

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

D3D11.h

Library

D3D11.lib

See also

D3D11_DEPTH_STENCIL_VIEW_DESC

CD3D11 Helper Structures