IDXGIFactoryPartner::CreateSwapChainForCompositionSurface method

Creates a swap chain that is associated with the composition surface for the swap chain.

Syntax

HRESULT CreateSwapChainForCompositionSurface(
  [in]            IUnknown *pDevice,
  [in, optional]  HANDLE hSurface,
  [in]            const DXGI_SWAP_CHAIN_DESC1 *pDesc,
  [in, optional]  IDXGIOutput *pRestrictToOutput,
  [out]           IDXGISwapChain1 **ppSwapChain
);

Parameters

  • pDevice [in]
    A pointer to the Direct3D device for the swap chain. This parameter can't be NULL.

  • hSurface [in, optional]
    The HANDLE value to the composition surface that is associated with the swap chain that CreateSwapChainForCompositionSurface creates. If you don't set this parameter, you can set it to NULL.

  • pDesc [in]
    A pointer to a DXGI_SWAP_CHAIN_DESC1 structure for the swap-chain description. This parameter can't be NULL.

  • pRestrictToOutput [in, optional]
    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 don't 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 CreateSwapChainForCompositionSurface creates.

Return value

CreateSwapChainForCompositionSurface returns:

  • 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.

Platform Update for Windows 7: On Windows 7 or Windows Server 2008 R2 with the Platform Update for Windows 7 installed, CreateSwapChainForCompositionSurface fails with E_NOTIMPL. For more info about the Platform Update for Windows 7, see Platform Update for Windows 7.

Requirements

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]

Header

DXGIPartner.h

Library

Dxgi.lib

See also

IDXGIFactoryPartner

 

 

Send comments about this topic to Microsoft

Build date: 8/14/2013