---
title: "getValues(_:forAttribute:forVirtualScreen:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsopenglpixelformat/getvalues(_:forattribute:forvirtualscreen:)"
---

# getValues(_:forAttribute:forVirtualScreen:)

Gets the value for the specified pixel format attribute.

## Declaration

```swift
func getValues(_ vals: UnsafeMutablePointer<GLint>, forAttribute attrib: NSOpenGLPixelFormatAttribute, forVirtualScreen screen: GLint)
```

## Parameters

- `vals`: On input, a pointer to a long variable. On output, the variable contains the value of the requested attribute.
- `attrib`: The requested attribute. For a list of attribute constants, see the table in Constants.
- `screen`: The screen from which you want to retrieve the attribute. This parameter must be a value between 0 and the number of virtual screens (doc://com.apple.appkit/documentation/AppKit/NSOpenGLPixelFormat/numberOfVirtualScreens) minus 1.

## Discussion

Discussion Because the value for an attribute may be different on each virtual screen, the virtual screen must be specified along with the attribute.

## See Also

### Related Documentation

- [init(attributes:)](appkit/nsopenglpixelformat/init(attributes:).md)

### Managing the Pixel Format

- [cglPixelFormatObj](appkit/nsopenglpixelformat/cglpixelformatobj.md)
- [numberOfVirtualScreens](appkit/nsopenglpixelformat/numberofvirtualscreens.md)
