IDXGISwapChain::SetFullscreenState Method

Sets the display state to windowed or full screen.

Syntax

public:
HRESULT SetFullscreenState(
         BOOL Fullscreen,
         IDXGIOutput *pTarget
)  

Parameters

Fullscreen
Type: BOOL 

A Boolean value that specifies whether to set the display state to windowed or full screen. TRUE for full screen, and FALSE for windowed.

pTarget
Type: IDXGIOutput *

[in, optional] If you pass TRUE to the Fullscreen parameter to set the display state to full screen, you can optionally set this parameter to a pointer to an IDXGIOutput interface for the output target that contains the swap chain. If you set this parameter to NULL, DXGI will choose the output based on the swap-chain’s device and the output window’s placement. If you pass FALSE to Fullscreen, you must set this parameter to NULL.

Return value

Type: HRESULT 

This methods returns:

Remarks

DXGI may change the display state of a swap chain in response to end user or system requests.

We recommend that you create a windowed swap chain and allow the end user to change the swap chain to full screen through SetFullscreenState; that is, do not set the Windowed member of DXGI_SWAP_CHAIN_DESC to FALSE to force the swap chain to be full screen. However, if you create the swap chain as full screen, also provide the end user with a list of supported display modes because a swap chain that is created with an unsupported display mode might cause the display to go black and prevent the end user from seeing anything. Also, we recommend that you have a time-out confirmation screen or other fallback mechanism when you allow the end user to change display modes.

Notes for

If a Microsoft Store app calls SetFullscreenState to set the display state to full screen, SetFullscreenState fails with DXGI_ERROR_NOT_CURRENTLY_AVAILABLE.

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

For the flip presentation model, after you transition the display state to full screen, you must call ResizeBuffers to ensure that your call to IDXGISwapChain1::Present1 succeeds.

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