<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: 13.1.0 - 13.1.0",
    "macOS: 10.5.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "QuartzCore",
  "identifier" : "/documentation/QuartzCore/CAOpenGLLayer/copyCGLPixelFormat(forDisplayMask:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Animation"
    ],
    "preciseIdentifier" : "c:objc(cs)CAOpenGLLayer(im)copyCGLPixelFormatForDisplayMask:"
  },
  "title" : "copyCGLPixelFormat(forDisplayMask:)"
}
-->

# copyCGLPixelFormat(forDisplayMask:)

Returns the OpenGL pixel format suitable for rendering to the set of displays specified by the display mask.

```
func copyCGLPixelFormat(forDisplayMask mask: UInt32) -> CGLPixelFormatObj
```

## Parameters

`mask`

The display mask the OpenGL content will be rendered on.

## Discussion

This method is called when a pixel format object is needed for the receiver.  The default implementation returns a 32bpp fixed point pixelf format, with the `NoRecovery` and `Accelerated` flags set.

You should not call this method directly, it is intended to be overridden by subclasses.

---

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)