<!--
{
  "availability" : [
    "macCatalyst: 13.1.0 - 18.0.0",
    "macOS: 10.4.0 - 15.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CoreVideo",
  "identifier" : "/documentation/CoreVideo/CVDisplayLinkCreateWithActiveCGDisplays(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Video"
    ],
    "preciseIdentifier" : "c:@F@CVDisplayLinkCreateWithActiveCGDisplays"
  },
  "title" : "CVDisplayLinkCreateWithActiveCGDisplays(_:)"
}
-->

# CVDisplayLinkCreateWithActiveCGDisplays(_:)

Creates a display link capable of being used with all active displays.

```
func CVDisplayLinkCreateWithActiveCGDisplays(_ displayLinkOut: UnsafeMutablePointer<CVDisplayLink?>) -> CVReturn
```

## Parameters

`displayLinkOut`

On output, `displayLinkOut` points to the newly created display link.

## Return Value

A Core Video result code. See [Core Video Constants](/documentation/CoreVideo/core-video-constants) for possible values.

## Discussion

`CVDisplayLinkCreateWithActiveCGDisplays` determines the displays actively used by the host computer and creates a display link compatible with all of them. For most applications, calling this function is the most convenient way to create a display link. After creation, you can assign the display link to any active display by calling the [`CVDisplayLinkSetCurrentCGDisplay(_:_:)`](/documentation/CoreVideo/CVDisplayLinkSetCurrentCGDisplay(_:_:)) function.

---

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)