DXGI Functions
This section provides detailed documentation for the functions available in the DirectX Graphics Infrastructure (DXGI) API. DXGI is responsible for managing graphics adapters, swap chains, and other essential graphics-related operations.
Core DXGI Functions
Creates an instance of the DXGI factory. Use this factory to enumerate adapters and create swap chains.
HRESULT CreateDXGIFactory1(REFIID riid, void **ppFactory);
Enables the operating system to notify your application when a graphics adapter is removed. This is crucial for graceful handling of adapter hot-plugging or removal events.
void DXGIDeclareAdapterRemovalSupport();
Reports the current configuration of a graphics adapter to the DXGI runtime. This function is primarily used by device drivers.
void DXGIReportAdapterConfiguration();
Adapter Enumeration and Information
Enumerates the graphics adapters available on the system. Each adapter represents a physical or virtual graphics card.
HRESULT EnumAdapters(UINT Adapter, IDXGIAdapter **ppAdapter);
Enumerates the graphics adapters available on the system, providing additional information compared to EnumAdapters.
HRESULT EnumAdapters1(UINT Adapter, IDXGIAdapter1 **ppAdapter);
Retrieves a description of the graphics adapter, including its name and device identifiers.
HRESULT GetDesc(DXGI_ADAPTER_DESC *pDesc);
Retrieves an extended description of the graphics adapter, including memory information.
HRESULT GetDesc1(DXGI_ADAPTER_DESC1 *pDesc);
Swap Chain Management
Creates a new swap chain. A swap chain is a queue of buffers that holds the frames to be presented to the output.
HRESULT CreateSwapChain(IUnknown *pDevice, DXGI_SWAP_CHAIN_DESC *pDesc, IDXGISwapChain **ppSwapChain);
Creates a swap chain associated with a specific window handle (HWND).
HRESULT CreateSwapChainForHwnd(IUnknown *pDevice, HWND hWnd, const DXGI_SWAP_CHAIN_DESC1 *pDesc, const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *pFullscreenDesc, IDXGIOutput *pRestrictToOutput, IDXGISwapChain1 **ppSwapChain);
Presents the next frame in the swap chain to the user.
HRESULT Present(UINT SyncInterval, UINT Flags);
Retrieves the description of the swap chain.
HRESULT GetDesc(DXGI_SWAP_CHAIN_DESC *pDesc);
Other Utility Functions
Checks for support of specific formats and capabilities. (Note: This is an enum flag, often used with CheckFormatSupport).
enum DXGI_FORMAT_SUPPORT1 : UINT;
Specifies how DXGI should handle window messages, such as Alt+Enter for fullscreen toggling.
HRESULT MakeWindowAssociation(HWND WindowHandle, UINT Flags);
For more in-depth details on specific function parameters, return values, and usage examples, please refer to the relevant interface documentation.