共用方式為


CD3D11_SAMPLER_DESC 結構 (d3d11.h)

表示取樣器狀態,並提供建立取樣器狀態的便利方法。

Syntax

struct CD3D11_SAMPLER_DESC : D3D11_SAMPLER_DESC {
  void CD3D11_SAMPLER_DESC();
  void CD3D11_SAMPLER_DESC(
    const D3D11_SAMPLER_DESC & o
  );
  void CD3D11_SAMPLER_DESC(
    CD3D11_DEFAULT unnamedParam1
  );
  void CD3D11_SAMPLER_DESC(
    D3D11_FILTER               filter,
    D3D11_TEXTURE_ADDRESS_MODE addressU,
    D3D11_TEXTURE_ADDRESS_MODE addressV,
    D3D11_TEXTURE_ADDRESS_MODE addressW,
    FLOAT                      mipLODBias,
    UINT                       maxAnisotropy,
    D3D11_COMPARISON_FUNC      comparisonFunc,
    const FLOAT                *borderColor,
    FLOAT                      minLOD,
    FLOAT                      maxLOD
  );
  void ~CD3D11_SAMPLER_DESC();
};

繼承

CD3D11_SAMPLER_DESC 結構會實作 D3D11_SAMPLER_DESC。

成員

void CD3D11_SAMPLER_DESC ()

具現化未初始化 CD3D11_SAMPLER_DESC 結構的新實例。

void CD3D11_SAMPLER_DESC ( const D3D11_SAMPLER_DESC & o)

具現化使用 D3D11_SAMPLER_DESC 結構初始化之CD3D11_SAMPLER_DESC結構的新實例。

void CD3D11_SAMPLER_DESC ( CD3D11_DEFAULT unnamedParam1)

具現化以預設取樣器狀態值初始化 之CD3D11_SAMPLER_DESC 結構的新實例。

void CD3D11_SAMPLER_DESC ( D3D11_FILTER filter, D3D11_TEXTURE_ADDRESS_MODE addressU, D3D11_TEXTURE_ADDRESS_MODE addressV, D3D11_TEXTURE_ADDRESS_MODE addressW, FLOAT mipLODBias, UINT maxAnisotropy, D3D11_COMPARISON_FUNC comparisonFunc, const FLOAT *borderColor, FLOAT minLOD, FLOAT maxLOD)

具現化使用 D3D11_SAMPLER_DESC 結構初始化之CD3D11_SAMPLER_DESC結構的新實例。

void ~CD3D11_SAMPLER_DESC ()

終結 CD3D11_SAMPLER_DESC 結構的實例。

備註

以下是 D3D11.h 定義 CD3D11_SAMPLER_DESC的方式:

struct CD3D11_SAMPLER_DESC : public D3D11_SAMPLER_DESC
{
    CD3D11_SAMPLER_DESC()
    {}
    explicit CD3D11_SAMPLER_DESC( const D3D11_SAMPLER_DESC& o ) :
        D3D11_SAMPLER_DESC( o )
    {}
    explicit CD3D11_SAMPLER_DESC( CD3D11_DEFAULT )
    {
        Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
        AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
        AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
        AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
        MipLODBias = 0;
        MaxAnisotropy = 1;
        ComparisonFunc = D3D11_COMPARISON_NEVER;
        BorderColor[ 0 ] = 1.0f;
        BorderColor[ 1 ] = 1.0f;
        BorderColor[ 2 ] = 1.0f;
        BorderColor[ 3 ] = 1.0f;
        MinLOD = -3.402823466e+38F; // -FLT_MAX
        MaxLOD = 3.402823466e+38F; // FLT_MAX
    }
    explicit CD3D11_SAMPLER_DESC(
        D3D11_FILTER filter,
        D3D11_TEXTURE_ADDRESS_MODE addressU,
        D3D11_TEXTURE_ADDRESS_MODE addressV,
        D3D11_TEXTURE_ADDRESS_MODE addressW,
        FLOAT mipLODBias,
        UINT maxAnisotropy,
        D3D11_COMPARISON_FUNC comparisonFunc,
        _In_reads_opt_( 4 ) const FLOAT* borderColor, // RGBA
        FLOAT minLOD,
        FLOAT maxLOD )
    {
        Filter = filter;
        AddressU = addressU;
        AddressV = addressV;
        AddressW = addressW;
        MipLODBias = mipLODBias;
        MaxAnisotropy = maxAnisotropy;
        ComparisonFunc = comparisonFunc;
        const float defaultColor[ 4 ] = { 1.0f, 1.0f, 1.0f, 1.0f };
        if (!borderColor) borderColor = defaultColor;
        BorderColor[ 0 ] = borderColor[ 0 ];
        BorderColor[ 1 ] = borderColor[ 1 ];
        BorderColor[ 2 ] = borderColor[ 2 ];
        BorderColor[ 3 ] = borderColor[ 3 ];
        MinLOD = minLOD;
        MaxLOD = maxLOD;
    }
    ~CD3D11_SAMPLER_DESC() {}
    operator const D3D11_SAMPLER_DESC&() const { return *this; }
};

規格需求

需求
最低支援的用戶端 Windows 7 [傳統型應用程式 |UWP 應用程式]
最低支援的伺服器 Windows Server 2008 R2 [傳統型應用程式 |UWP 應用程式]
標頭 d3d11.h

另請參閱

CD3D11 協助程序結構