---
title: "openGLPixelFormat(forDisplayMask:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsopengllayer/openglpixelformat(fordisplaymask:)"
---

# openGLPixelFormat(forDisplayMask:)

Returns the OpenGL pixel format suitable for the specified displays.

## Declaration

```swift
func openGLPixelFormat(forDisplayMask mask: UInt32) -> NSOpenGLPixelFormat
```

## Parameters

- `mask`: A mask specifying the displays the returned doc://com.apple.appkit/documentation/AppKit/NSOpenGLPixelFormat must be suitable for.

## Return Value

Return Value An autoreleased NSOpenGLPixelFormat object suitable for the displays.

## Discussion

Discussion You must include an NSOpenGLPFAScreenMask specification in the pixel format attribute list that’s used to instantiate the NSOpenGLPixelFormat.

## See Also

### Managing the Pixel Format

- [openGLPixelFormat](appkit/nsopengllayer/openglpixelformat.md)
