DirectX Graphics Infrastructure (DXGI)

Microsoft Docs

IDXGIFactory Interface

The IDXGIFactory interface is the factory interface for creating DXGI objects. It provides methods for enumerating adapters and other DXGI objects.

Interface Requirements

Minimum supported client: Windows 7

Minimum supported server: Windows Server 2008 R2

Header file: dxgi.h

Library: dxgi.lib

Interface Method Table

The IDXGIFactory interface inherits from the IUnknown interface.

The IDXGIFactory interface also has these types of members:

  • Methods

Methods

The IDXGIFactory interface inherits the following methods from the IUnknown interface:

Method Description
QueryInterface Checks to see if the current COM object is re-entrant.
AddRef Increments the reference count for the object.
Release Decrements the reference count for the object.

The IDXGIFactory interface also has these methods.

Method Description
EnumAdapters Enumerates the display adapters available on the system.
EnumAdapters1 Enumerates the display adapters available on the system.
GetAdapterCount Gets the number of display adapters available on the system.
GetAdapterByDeviceName Gets a display adapter by its device name.
GetDefaultAdapterInterface Gets the default adapter for the system.
MakeWindowAssociation Associates the factory with a window.
RegisterOutputCallback Registers a callback interface to receive notifications about output changes.
UnregisterOutputCallback Unregisters a callback interface for notifications about output changes.
EnumAdaptersWithInterface Enumerates adapters that are associated with a specific interface.

EnumAdapters

Enumerates the display adapters available on the system.


HRESULT STDMETHODCALLTYPE EnumAdapters(
    UINT Adapter,
    IDXGIAdapter **ppAdapter
);

EnumAdapters1

Enumerates the display adapters available on the system.


HRESULT STDMETHODCALLTYPE EnumAdapters1(
    UINT Adapter,
    IDXGIAdapter1 **ppAdapter
);

GetAdapterCount

Gets the number of display adapters available on the system.


HRESULT STDMETHODCALLTYPE GetAdapterCount(
    UINT *pAdapterCount
);

GetAdapterByDeviceName

Gets a display adapter by its device name.


HRESULT STDMETHODCALLTYPE GetAdapterByDeviceName(
    LPCWSTR pszDeviceName,
    IDXGIAdapter **ppAdapter
);

GetDefaultAdapterInterface

Gets the default adapter for the system.


HRESULT STDMETHODCALLTYPE GetDefaultAdapterInterface(
    IDXGIAdapter **ppAdapter
);

MakeWindowAssociation

Associates the factory with a window.


HRESULT STDMETHODCALLTYPE MakeWindowAssociation(
    HWND WindowHandle,
    UINT Flags
);

RegisterOutputCallback

Registers a callback interface to receive notifications about output changes.


HRESULT STDMETHODCALLTYPE RegisterOutputCallback(
    IDXGIOutputCallback *pCallback
);

UnregisterOutputCallback

Unregisters a callback interface for notifications about output changes.


HRESULT STDMETHODCALLTYPE UnregisterOutputCallback(
    IDXGIOutputCallback *pCallback
);

EnumAdaptersWithInterface

Enumerates adapters that are associated with a specific interface.


HRESULT STDMETHODCALLTYPE EnumAdaptersWithInterface(
    UINT Adapter,
    REFIID riid,
    void **ppvAdapter
);