Skip to content

Latest commit

 

History

History
120 lines (89 loc) · 5.43 KB

nf-dxgi-createdxgifactory1.md

File metadata and controls

120 lines (89 loc) · 5.43 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:dxgi.CreateDXGIFactory1
CreateDXGIFactory1 function (dxgi.h)
Creates a DXGI 1.1 factory that you can use to generate other DXGI objects.
CreateDXGIFactory1
CreateDXGIFactory1 function [DXGI]
cbbcd6f0-23c8-ef1c-0d0c-2b56092eb8b1
direct3ddxgi.createdxgifactory1
dxgi/CreateDXGIFactory1
direct3ddxgi\createdxgifactory1.htm
direct3ddxgi
6fb9d7a3-0b59-4b7a-8871-b99d59811d46
12/05/2018
CreateDXGIFactory1, CreateDXGIFactory1 function [DXGI], cbbcd6f0-23c8-ef1c-0d0c-2b56092eb8b1, direct3ddxgi.createdxgifactory1, dxgi/CreateDXGIFactory1
dxgi.h
Windows
Windows 7 [desktop apps \| UWP apps]
Windows Server 2008 R2 [desktop apps \| UWP apps]
DXGI.lib
Dxgi.dll
Windows
19H1
CreateDXGIFactory1
dxgi/CreateDXGIFactory1
c++
APIRef
kbSyntax
DllExport
dxgi.dll
CreateDXGIFactory1

CreateDXGIFactory1 function

-description

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

-parameters

-param riid

Type: REFIID

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

-param ppFactory [out]

Type: void**

Address of a pointer to an IDXGIFactory1 object.

-returns

Type: HRESULT

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

-remarks

Use a DXGI 1.1 factory to generate objects that enumerate adapters, create swap chains, and associate a window with the alt+enter key sequence for toggling to and from the full-screen display mode.

If the CreateDXGIFactory1 function succeeds, the reference count on the IDXGIFactory1 interface is incremented. To avoid a memory leak, when you finish using the interface, call the IDXGIFactory1::Release method to release the interface.

This entry point is not supported by DXGI 1.0, which shipped in Windows Vista and Windows Server 2008. DXGI 1.1 support is required, which is available on Windows 7, Windows Server 2008 R2, and as an update to Windows Vista with Service Pack 2 (SP2) (KB 971644) and Windows Server 2008 (KB 971512).

Note  Do not mix the use of DXGI 1.0 (IDXGIFactory) and DXGI 1.1 (IDXGIFactory1) in an application. Use IDXGIFactory or IDXGIFactory1, but not both in an application.
 
Note  CreateDXGIFactory1 fails if your app's DllMain function calls it. For more info about how DXGI responds from DllMain, see DXGI Responses from DLLMain.
 
Note  Starting with Windows 8, all DXGI factories (regardless if they were created with CreateDXGIFactory or CreateDXGIFactory1) enumerate adapters identically. The enumeration order of adapters, which you retrieve with IDXGIFactory::EnumAdapters or IDXGIFactory1::EnumAdapters1, is as follows:
  • Adapter with the output on which the desktop primary is displayed. This adapter corresponds with an index of zero.
  • Adapters with outputs.
  • Adapters without outputs.
 

Examples

Creating a DXGI 1.1 Factory

The following code example demonstrates how to create a DXGI 1.1 factory. This example uses the __uuidof() intrinsic to obtain the REFIID, or GUID, of the IDXGIFactory1 interface.


IDXGIFactory1 * pFactory;
HRESULT hr = CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void**)(&pFactory) );
          

-see-also

DXGI Functions