DirectX Graphics Infrastructure (DXGI)

API Reference

DXGI_MODE_DESC Structure

The DXGI_MODE_DESC structure describes a display mode.

Syntax

typedef struct DXGI_MODE_DESC {
    UINT Width;
    UINT Height;
    DXGI_RATIONAL RefreshRate;
    DXGI_FORMAT Format;
    DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
    DXGI_MODE_SCALING Scaling;
} DXGI_MODE_DESC;

Members

Width

The width of the display mode, in pixels.

Height

The height of the display mode, in pixels.

RefreshRate

A DXGI_RATIONAL structure that describes the refresh rate of the display mode, in Hz.

Format

A DXGI_FORMAT-typed value that specifies the pixel format.

ScanlineOrdering

A DXGI_MODE_SCANLINE_ORDER-typed value that specifies the scanline rendering order.

Possible values include:

  • DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED
  • DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE
  • DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST
  • DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST
Scaling

A DXGI_MODE_SCALING-typed value that specifies how the content is scaled to fit the display.

Possible values include:

  • DXGI_MODE_SCALING_UNSPECIFIED
  • DXGI_MODE_SCALING_CENTERED
  • DXGI_MODE_SCALING_STRETCHED

Remarks

The DXGI_MODE_DESC structure is used by the following methods:

Example Usage

This is a placeholder for example usage code. In a real scenario, this would demonstrate how to populate and use the DXGI_MODE_DESC structure.

// Example structure initialization
DXGI_MODE_DESC modeDesc = {};
modeDesc.Width = 1920;
modeDesc.Height = 1080;
modeDesc.RefreshRate = { 60, 1 }; // 60 Hz
modeDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
modeDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE;
modeDesc.Scaling = DXGI_MODE_SCALING_STRETCHED;

// Further usage of modeDesc would go here...
Note: When specifying a display mode, ensure that the requested width, height, and refresh rate are supported by the display adapter and monitor. The GetDisplayModeList method can be used to retrieve a list of supported modes.