IDirect3DDevice9::CreateAdditionalSwapChain method

Creates an additional swap chain for rendering multiple views.

Syntax

HRESULT CreateAdditionalSwapChain(
  D3DPRESENT_PARAMETERS *pPresentationParameters,
  IDirect3DSwapChain9   **pSwapChain
);

Parameters

pPresentationParameters

Type: D3DPRESENT_PARAMETERS*

Pointer to a D3DPRESENT_PARAMETERS structure, containing the presentation parameters for the new swap chain. This value cannot be NULL.

Calling this method changes the value of members of the D3DPRESENT_PARAMETERS structure.

  • If BackBufferCount == 0, calling CreateAdditionalSwapChain will increase it to 1.
  • If the application is in windowed mode, and if either the BackBufferWidth or the BackBufferHeight == 0, they will be set to the client area width and height of the hwnd.

pSwapChain

Type: IDirect3DSwapChain9**

Address of a pointer to an IDirect3DSwapChain9 interface, representing the additional swap chain.

Return Value

Type: HRESULT

If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be one of the following: D3DERR_NOTAVAILABLE, D3DERR_DEVICELOST, D3DERR_INVALIDCALL, D3DERR_OUTOFVIDEOMEMORY, E_OUTOFMEMORY.

Remarks

There is always at least one swap chain (the implicit swap chain) for each device because Direct3D 9 has one swap chain as a property of the device.

Note that any given device can support only one full-screen swap chain.

D3DFMT_UNKNOWN can be specified for the windowed mode back buffer format when calling IDirect3D9::CreateDevice, IDirect3DDevice9::Reset and CreateAdditionalSwapChain. This means the application does not have to query the current desktop format before calling CreateDevice for windowed mode. For full-screen mode, the back buffer format must be specified.

Requirements

   
Target Platform Windows
Header d3d9.h (include D3D9.h)
Library D3D9.lib

See Also

IDirect3DDevice9

Presenting Multiple Views in Windowed Mode (Direct3D 9)