Creates a swap chain that is associated with the CoreWindow object for the output window for the swap chain.
HRESULT CreateSwapChainForCoreWindow( [in] IUnknown *pDevice, [in] IUnknown *pWindow, [in] const DXGI_SWAP_CHAIN_DESC1 *pDesc, [in] IDXGIOutput *pRestrictToOutput, [out] IDXGISwapChain1 **ppSwapChain );
- pDevice [in]
A pointer to the Direct3D device for the swap chain. This parameter cannot be NULL.
- pWindow [in]
A pointer to the CoreWindow object that is associated with the swap chain that CreateSwapChainForCoreWindow creates.
- pDesc [in]
A pointer to a DXGI_SWAP_CHAIN_DESC1 structure for the swap-chain description. This parameter cannot be NULL.
- pRestrictToOutput [in]
A pointer to the IDXGIOutput interface that the swap chain is restricted to. If the swap chain is moved to a different output, the content is black. You can optionally set this parameter to an output target that uses DXGI_PRESENT_RESTRICT_TO_OUTPUT to restrict the content on this output. If you do not set this parameter to restrict content on an output target, you can set it to NULL.
- ppSwapChain [out]
A pointer to a variable that receives a pointer to the IDXGISwapChain1 interface for the swap chain that CreateSwapChainForCoreWindow creates.
- S_OK if it successfully created a swap chain.
- E_OUTOFMEMORY if memory is unavailable to complete the operation.
- DXGI_ERROR_INVALID_CALL if the calling application provided invalid data, for example, if pDesc or ppSwapChain is NULL.
- Possibly other error codes that are described in the DXGI_ERROR topic that are defined by the type of device that you pass to pDevice.
Note Use this method in Windows Store apps rather than IDXGIFactory2::CreateSwapChainForHwnd.
If you specify the width, height, or both (Width and Height members of DXGI_SWAP_CHAIN_DESC1 that pDesc points to) of the swap chain as zero, the runtime obtains the size from the output window that the pWindow parameter specifies. You can subsequently call the IDXGISwapChain1::GetDesc1 method to retrieve the assigned width or height value.
Because you can associate only one flip presentation model swap chain at a time with a CoreWindow, the Microsoft Direct3D 11 policy of deferring the destruction of objects can cause problems if you attempt to destroy a flip presentation model swap chain and replace it with another swap chain. For more info about this situation, see Deferred Destruction Issues with Flip Presentation Swap Chains.
For info about how to choose a format for the swap chain's back buffer, see Converting data for the color space.
Windows Phone 8: This API is supported.
Minimum supported client
|Windows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]|
Minimum supported server
|Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | Windows Store apps]|
Build date: 11/22/2012