Microsoft Docs

Documentation for Windows Developers

DirectX Graphics Infrastructure (DXGI)

The DirectX Graphics Infrastructure (DXGI) is a fundamental component of DirectX that enables graphics hardware to communicate with applications. It provides a set of interfaces and functions that manage adapters, output devices, and swap chains, facilitating the rendering and presentation of graphics.

Introduction

DXGI is responsible for abstracting the underlying graphics hardware and providing a consistent API for applications to interact with it. This includes enumerating available graphics adapters, selecting appropriate display output targets, and managing the presentation of rendered frames to the screen.

Key Concepts

Core Interfaces

DXGI defines several key interfaces that applications use to interact with the graphics subsystem:

IDXGIFactory

The root interface for DXGI. It's used to create DXGI objects and enumerate adapters.

interface IDXGIFactory : IUnknown { ... }

Methods:

  • EnumAdapters: Enumerates the graphics adapters.
  • MakeWindowAssociation: Associates a window with DXGI for presentation.
  • CreateSwapChain: Creates a swap chain.

IDXGIAdapter

Represents a graphics adapter.

interface IDXGIAdapter : IDXGIObject { ... }

Methods:

  • EnumOutputs: Enumerates the outputs connected to this adapter.
  • GetDesc: Retrieves a description of the adapter.

IDXGIOutput

Represents a display output.

interface IDXGIOutput : IDXGIObject { ... }

Methods:

  • GetDesc: Retrieves a description of the output.
  • GetDisplayModeList: Retrieves a list of supported display modes.

IDXGISwapChain

Represents a swap chain for presenting rendered frames.

interface IDXGISwapChain : IDXGIObject { ... }

Methods:

  • Present: Presents the next buffer in the swap chain.
  • GetBuffer: Retrieves a back buffer.
  • ResizeBuffers: Resizes the swap chain buffers.

See Also