IDXGISwapChain::ResizeTarget Method

Resizes the output target.

Syntax

public:
HRESULT ResizeTarget(
         const DXGI_MODE_DESC *pNewTargetParameters
)  

Parameters

pNewTargetParameters
Type: DXGI_MODE_DESC *

[in] A pointer to a DXGI_MODE_DESC structure that describes the mode, which specifies the new width, height, format, and refresh rate of the target. If the format is DXGI_FORMAT_UNKNOWN, ResizeTarget uses the existing format. We only recommend that you use DXGI_FORMAT_UNKNOWN when the swap chain is in full-screen mode as this method is not thread safe.

Return value

Type: HRESULT 

Returns a code that indicates success or failure. DXGI_STATUS_MODE_CHANGE_IN_PROGRESS is returned if a fullscreen/windowed mode transition is occurring when this API is called. See DXGI_ERROR for additional DXGI error codes.

Remarks

ResizeTarget resizes the target window when the swap chain is in windowed mode, and changes the display mode on the target output when the swap chain is in full-screen mode. Therefore, applications can call ResizeTarget to resize the target window (rather than a Microsoft Win32API such as SetWindowPos) without knowledge of the swap chain display mode.

If a Microsoft Store app calls ResizeTarget, it fails with DXGI_ERROR_NOT_CURRENTLY_AVAILABLE.

You cannot call ResizeTarget on a windowless swap chain that you created with IDXGIFactory2::CreateSwapChainForComposition.

Requirements

Header: Declared in d3d11_x.h (dxgi.h on other Windows platforms).

Library: Use d3d11_x.lib (dxgi.lib on other Windows platforms).

See also

IDXGISwapChain

IDXGISwapChain Members