---
title: "copyCGLPixelFormat(forDisplayMask:)"
framework: quartzcore
role: symbol
role_heading: Instance Method
path: "quartzcore/caopengllayer/copycglpixelformat(fordisplaymask:)"
---

# copyCGLPixelFormat(forDisplayMask:)

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

## Declaration

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

## Parameters

- `mask`: The display mask the OpenGL content will be rendered on.

## Discussion

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.

## See Also

### Managing Pixel Format

- [releaseCGLPixelFormat(_:)](quartzcore/caopengllayer/releasecglpixelformat(_:).md)
