다음을 통해 공유


CD3D11_VIEWPORT 구조체(d3d11.h)

뷰포트를 나타내며 뷰포트를 만들기 위한 편리한 메서드를 제공합니다.

Syntax

struct CD3D11_VIEWPORT : D3D11_VIEWPORT {
  void CD3D11_VIEWPORT();
  void CD3D11_VIEWPORT(
    const D3D11_VIEWPORT & o
  );
  void CD3D11_VIEWPORT(
    FLOAT topLeftX,
    FLOAT topLeftY,
    FLOAT width,
    FLOAT height,
    FLOAT minDepth,
    FLOAT maxDepth
  );
  void CD3D11_VIEWPORT(
    ID3D11Buffer           *unnamedParam1,
    ID3D11RenderTargetView *pRTView,
    FLOAT                  topLeftX,
    FLOAT                  minDepth,
    FLOAT                  maxDepth
  );
  void CD3D11_VIEWPORT(
    ID3D11Texture1D        *pTex1D,
    ID3D11RenderTargetView *pRTView,
    FLOAT                  topLeftX,
    FLOAT                  minDepth,
    FLOAT                  maxDepth
  );
  void CD3D11_VIEWPORT(
    ID3D11Texture2D        *pTex2D,
    ID3D11RenderTargetView *pRTView,
    FLOAT                  topLeftX,
    FLOAT                  topLeftY,
    FLOAT                  minDepth,
    FLOAT                  maxDepth
  );
  void CD3D11_VIEWPORT(
    ID3D11Texture3D        *pTex3D,
    ID3D11RenderTargetView *pRTView,
    FLOAT                  topLeftX,
    FLOAT                  topLeftY,
    FLOAT                  minDepth,
    FLOAT                  maxDepth
  );
  void ~CD3D11_VIEWPORT();
};

상속

CD3D11_VIEWPORT 구조체는 D3D11_VIEWPORT 구현합니다.

멤버

void CD3D11_VIEWPORT()

초기화되지 않은 CD3D11_VIEWPORT 구조체의 새 instance 인스턴스화합니다.

void CD3D11_VIEWPORT( const D3D11_VIEWPORT & o)

D3D11_VIEWPORT 구조체로 초기화된 CD3D11_VIEWPORT 구조체의 새 instance 인스턴스화합니다.

void CD3D11_VIEWPORT( FLOAT topLeftX, FLOAT topLeftY, FLOAT width, FLOAT height, FLOAT minDepth, FLOAT maxDepth)

D3D11_VIEWPORT 값으로 초기화된 CD3D11_VIEWPORT 구조체의 새 instance 인스턴스화합니다.

void CD3D11_VIEWPORT( ID3D11Buffer *unnamedParam1, ID3D11RenderTargetView *pRTView, FLOAT topLeftX, FLOAT minDepth, FLOAT maxDepth)

D3D11_BUFFER_RTV 값으로 초기화된 CD3D11_VIEWPORT 구조체의 새 instance 인스턴스화합니다.

void CD3D11_VIEWPORT( ID3D11Texture1D *pTex1D, ID3D11RenderTargetView *pRTView, FLOAT topLeftX, FLOAT minDepth, FLOAT maxDepth)

D3D11_TEX1D_RTV 또는 D3D11_TEX1D_ARRAY_RTV 값으로 초기화된 CD3D11_VIEWPORT 구조체의 새 instance 인스턴스화합니다.

void CD3D11_VIEWPORT( ID3D11Texture2D *pTex2D, ID3D11RenderTargetView *pRTView, FLOAT topLeftX, FLOAT topLeftY, FLOAT minDepth, FLOAT maxDepth)

2D 텍스처 값으로 초기화된 CD3D11_VIEWPORT 구조체의 새 instance 인스턴스화합니다.

void CD3D11_VIEWPORT( ID3D11Texture3D *pTex3D, ID3D11RenderTargetView *pRTView, FLOAT topLeftX, FLOAT topLeftY, FLOAT minDepth, FLOAT maxDepth)

3D 텍스처 값으로 초기화된 CD3D11_VIEWPORT 구조체의 새 instance 인스턴스화합니다.

void ~CD3D11_VIEWPORT()

CD3D11_VIEWPORT 구조체의 instance 제거합니다.

설명

D3D11.h에서 CD3D11_VIEWPORT 정의하는 방법은 다음과 같습니다.

struct CD3D11_VIEWPORT : public D3D11_VIEWPORT
{
    CD3D11_VIEWPORT()
    {}
    explicit CD3D11_VIEWPORT( const D3D11_VIEWPORT& o ) :
        D3D11_VIEWPORT( o )
    {}
    explicit CD3D11_VIEWPORT(
        FLOAT topLeftX,
        FLOAT topLeftY,
        FLOAT width,
        FLOAT height,
        FLOAT minDepth = D3D11_MIN_DEPTH,
        FLOAT maxDepth = D3D11_MAX_DEPTH )
    {
        TopLeftX = topLeftX;
        TopLeftY = topLeftY;
        Width = width;
        Height = height;
        MinDepth = minDepth;
        MaxDepth = maxDepth;
    }
    explicit CD3D11_VIEWPORT(
        _In_ ID3D11Buffer*,
        _In_ ID3D11RenderTargetView* pRTView,
        FLOAT topLeftX = 0.0f,
        FLOAT minDepth = D3D11_MIN_DEPTH,
        FLOAT maxDepth = D3D11_MAX_DEPTH )
    {
        D3D11_RENDER_TARGET_VIEW_DESC RTVDesc;
        pRTView->GetDesc( &RTVDesc );
        UINT NumElements = 0;
        switch (RTVDesc.ViewDimension)
        {
        case D3D11_RTV_DIMENSION_BUFFER:
            NumElements = RTVDesc.Buffer.NumElements;
            break;
        default: break;
        }
        TopLeftX = topLeftX;
        TopLeftY = 0.0f;
        Width = NumElements - topLeftX;
        Height = 1.0f;
        MinDepth = minDepth;
        MaxDepth = maxDepth;
    }
    explicit CD3D11_VIEWPORT(
        _In_ ID3D11Texture1D* pTex1D,
        _In_ ID3D11RenderTargetView* pRTView,
        FLOAT topLeftX = 0.0f,
        FLOAT minDepth = D3D11_MIN_DEPTH,
        FLOAT maxDepth = D3D11_MAX_DEPTH )
    {
        D3D11_TEXTURE1D_DESC TexDesc;
        pTex1D->GetDesc( &TexDesc );
        D3D11_RENDER_TARGET_VIEW_DESC RTVDesc;
        pRTView->GetDesc( &RTVDesc );
        UINT MipSlice = 0;
        switch (RTVDesc.ViewDimension)
        {
        case D3D11_RTV_DIMENSION_TEXTURE1D:
            MipSlice = RTVDesc.Texture1D.MipSlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE1DARRAY:
            MipSlice = RTVDesc.Texture1DArray.MipSlice;
            break;
        default: break;
        }
        const UINT SubResourceWidth = TexDesc.Width / (UINT( 1 ) << MipSlice);
        TopLeftX = topLeftX;
        TopLeftY = 0.0f;
        Width = (SubResourceWidth ? SubResourceWidth : 1) - topLeftX;
        Height = 1.0f;
        MinDepth = minDepth;
        MaxDepth = maxDepth;
    }
    explicit CD3D11_VIEWPORT(
        _In_ ID3D11Texture2D* pTex2D,
        _In_ ID3D11RenderTargetView* pRTView,
        FLOAT topLeftX = 0.0f,
        FLOAT topLeftY = 0.0f,
        FLOAT minDepth = D3D11_MIN_DEPTH,
        FLOAT maxDepth = D3D11_MAX_DEPTH )
    {
        D3D11_TEXTURE2D_DESC TexDesc;
        pTex2D->GetDesc( &TexDesc );
        D3D11_RENDER_TARGET_VIEW_DESC RTVDesc;
        pRTView->GetDesc( &RTVDesc );
        UINT MipSlice = 0;
        switch (RTVDesc.ViewDimension)
        {
        case D3D11_RTV_DIMENSION_TEXTURE2D:
            MipSlice = RTVDesc.Texture2D.MipSlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2DARRAY:
            MipSlice = RTVDesc.Texture2DArray.MipSlice;
            break;
        case D3D11_RTV_DIMENSION_TEXTURE2DMS:
        case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY:
            break;
        default: break;
        }
        const UINT SubResourceWidth = TexDesc.Width / (UINT( 1 ) << MipSlice);
        const UINT SubResourceHeight = TexDesc.Height / (UINT( 1 ) << MipSlice);
        TopLeftX = topLeftX;
        TopLeftY = topLeftY;
        Width = (SubResourceWidth ? SubResourceWidth : 1) - topLeftX;
        Height = (SubResourceHeight ? SubResourceHeight : 1) - topLeftY;
        MinDepth = minDepth;
        MaxDepth = maxDepth;
    }
    explicit CD3D11_VIEWPORT(
        _In_ ID3D11Texture3D* pTex3D,
        _In_ ID3D11RenderTargetView* pRTView,
        FLOAT topLeftX = 0.0f,
        FLOAT topLeftY = 0.0f,
        FLOAT minDepth = D3D11_MIN_DEPTH,
        FLOAT maxDepth = D3D11_MAX_DEPTH )
    {
        D3D11_TEXTURE3D_DESC TexDesc;
        pTex3D->GetDesc( &TexDesc );
        D3D11_RENDER_TARGET_VIEW_DESC RTVDesc;
        pRTView->GetDesc( &RTVDesc );
        UINT MipSlice = 0;
        switch (RTVDesc.ViewDimension)
        {
        case D3D11_RTV_DIMENSION_TEXTURE3D:
            MipSlice = RTVDesc.Texture3D.MipSlice;
            break;
        default: break;
        }
        const UINT SubResourceWidth = TexDesc.Width / (UINT( 1 ) << MipSlice);
        const UINT SubResourceHeight = TexDesc.Height / (UINT( 1 ) << MipSlice);
        TopLeftX = topLeftX;
        TopLeftY = topLeftY;
        Width = (SubResourceWidth ? SubResourceWidth : 1) - topLeftX;
        Height = (SubResourceHeight ? SubResourceHeight : 1) - topLeftY;
        MinDepth = minDepth;
        MaxDepth = maxDepth;
    }
    ~CD3D11_VIEWPORT() {}
    operator const D3D11_VIEWPORT&() const { return *this; }
};

요구 사항

요구 사항
지원되는 최소 클라이언트 Windows 7 [데스크톱 앱 | UWP 앱]
지원되는 최소 서버 Windows Server 2008 R2 [데스크톱 앱 | UWP 앱]
머리글 d3d11.h

추가 정보

CD3D11 도우미 구조체