<!--
{
  "availability" : [
    "macCatalyst: 13.1.0 -",
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGConfigureDisplayWithDisplayMode(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@F@CGConfigureDisplayWithDisplayMode"
  },
  "title" : "CGConfigureDisplayWithDisplayMode(_:_:_:_:)"
}
-->

# CGConfigureDisplayWithDisplayMode(_:_:_:_:)

Configures the display mode of a display.

```
func CGConfigureDisplayWithDisplayMode(_ config: CGDisplayConfigRef?, _ display: CGDirectDisplayID, _ mode: CGDisplayMode?, _ options: CFDictionary?) -> CGError
```

## Parameters

`config`

A display configuration you aquire by calling [`CGBeginDisplayConfiguration(_:)`](/documentation/CoreGraphics/CGBeginDisplayConfiguration(_:)).

`display`

The identifier of the display to configure.

`mode`

A display mode to configure.

`options`

Reserved for future expansion. Pass `NULL` for now.

## Return Value

A result code. If the request to change modes is successful, the result is `kCGErrorSuccess`. For other possible values, see [`CGError`](/documentation/CoreGraphics/CGError).

## Discussion

This function allows you to specify a display mode with which to configure the display using a transaction. Before using this function, call [`CGBeginDisplayConfiguration(_:)`](/documentation/CoreGraphics/CGBeginDisplayConfiguration(_:)) to acquire the display configuration token for the desired display. Call [`CGCompleteDisplayConfiguration(_:_:)`](/documentation/CoreGraphics/CGCompleteDisplayConfiguration(_:_:)) to execute the transaction.

Using this function to change the mode of a display in a mirroring set might cause Quartz to adjust settings of the other displays in the set. When necessary, Quartz adjusts the bounds, resolutions, and depth of the displays to a safe mode with matching depth and the smallest enclosing size.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)