Sets the display state to windowed or full screen.
- Fullscreen [in]
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 [in]
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.
This methods returns:
- S_OK if the action succeeded and the swap chain was placed in the requested state.
- DXGI_ERROR_NOT_CURRENTLY_AVAILABLE if the action failed. There are many reasons why a windowed-mode swap chain cannot switch to full-screen mode. For instance:
- The application is running over Terminal Server.
- The output window is occluded.
- The output window does not have keyboard focus.
- Another application is already in full-screen mode.
When this error is returned, an application can continue to run in windowed mode and try to switch to full-screen mode later.
- DXGI_STATUS_MODE_CHANGE_IN_PROGRESS is returned if a fullscreen/windowed mode transition is occurring when this API is called.
- Other error codes if you run out of memory or encounter another unexpected fault; these codes may be treated as hard, non-continuable errors.
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.
If a Windows 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.