Skip to main content

Windows Dev Center

CreateDXGIFactory2 function

Creates a DXGI 1.3 factory that you can use to generate other DXGI objects.

In Windows 8, any DXGI factory created while DXGIDebug.dll was present on the system would load and use it. Starting in Windows 8.1, apps explicitly request that DXGIDebug.dll be loaded instead. Use CreateDXGIFactory2 and specify the DXGI_CREATE_FACTORY_DEBUG flag to request DXGIDebug.dll; the DLL will be loaded if it is present on the system.

Syntax


HRESULT CreateDXGIFactory2(
        UINT   Flags,
        REFIID riid,
  _Out_ void   **ppFactory
);

Parameters

Flags

Type: UINT

Valid values include the DXGI_CREATE_FACTORY_DEBUG (0x01) flag, and zero.

Note  This flag will be set by the D3D runtime if:
  • The system creates an implicit factory during device creation.
  • The D3D11_CREATE_DEVICE_DEBUG flag is specified during device creation, for example using D3D11CreateDevice (or the swapchain method, or the Direct3D 10 equivalents).
 
riid

Type: REFIID

The globally unique identifier (GUID) of the IDXGIFactory2 object referenced by the ppFactory parameter.

ppFactory [out]

Type: void**

Address of a pointer to an IDXGIFactory2 object.

Return value

Type: HRESULT

Returns S_OK if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

Remarks

This function accepts a flag indicating whether DXGIDebug.dll is loaded. The function otherwise behaves identically to CreateDXGIFactory1.

Windows Phone 8.1: This API is supported.

Requirements

Minimum supported client

Windows 8.1 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 R2 [desktop apps | Windows Store apps]

Header

Dxgi1_3.h

Library

DXGI.lib

DLL

Dxgi.dll

See also

DXGI Functions