---
title: "CGConfigureDisplayWithDisplayMode(_:_:_:_:)"
framework: coregraphics
role: symbol
role_heading: Function
path: "coregraphics/cgconfiguredisplaywithdisplaymode(_:_:_:_:)"
---

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

Configures the display mode of a display.

## Declaration

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

## Parameters

- `config`: A display configuration you aquire by calling doc://com.apple.coregraphics/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

Return Value A result code. If the request to change modes is successful, the result is kCGErrorSuccess. For other possible values, see CGError.

## Discussion

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(_:) to acquire the display configuration token for the desired display. Call 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.

## See Also

### Functions

- [CGAcquireDisplayFadeReservation(_:_:)](coregraphics/cgacquiredisplayfadereservation(_:_:).md)
- [CGAssociateMouseAndMouseCursorPosition(_:)](coregraphics/cgassociatemouseandmousecursorposition(_:).md)
- [CGBeginDisplayConfiguration(_:)](coregraphics/cgbegindisplayconfiguration(_:).md)
- [CGCancelDisplayConfiguration(_:)](coregraphics/cgcanceldisplayconfiguration(_:).md)
- [CGCaptureAllDisplays()](coregraphics/cgcapturealldisplays().md)
- [CGCaptureAllDisplaysWithOptions(_:)](coregraphics/cgcapturealldisplayswithoptions(_:).md)
- [CGCompleteDisplayConfiguration(_:_:)](coregraphics/cgcompletedisplayconfiguration(_:_:).md)
- [CGConfigureDisplayFadeEffect(_:_:_:_:_:_:)](coregraphics/cgconfiguredisplayfadeeffect(_:_:_:_:_:_:).md)
- [CGConfigureDisplayMirrorOfDisplay(_:_:_:)](coregraphics/cgconfiguredisplaymirrorofdisplay(_:_:_:).md)
- [CGConfigureDisplayMode(_:_:_:)](coregraphics/cgconfiguredisplaymode(_:_:_:).md)
- [CGConfigureDisplayOrigin(_:_:_:_:)](coregraphics/cgconfiguredisplayorigin(_:_:_:_:).md)
- [CGConfigureDisplayStereoOperation(_:_:_:_:)](coregraphics/cgconfiguredisplaystereooperation(_:_:_:_:).md)
- [CGCursorIsDrawnInFramebuffer()](coregraphics/cgcursorisdrawninframebuffer().md)
- [CGCursorIsVisible()](coregraphics/cgcursorisvisible().md)
- [CGDirectDisplayCopyCurrentMetalDevice(_:)](coregraphics/cgdirectdisplaycopycurrentmetaldevice(_:).md)
