<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSOpenGLPixelFormat/getValues(_:forAttribute:forVirtualScreen:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSOpenGLPixelFormat(im)getValues:forAttribute:forVirtualScreen:"
  },
  "title" : "getValues(_:forAttribute:forVirtualScreen:)"
}
-->

# getValues(_:forAttribute:forVirtualScreen:)

Gets the value for the specified pixel format attribute.

```
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 ([`numberOfVirtualScreens`](/documentation/AppKit/NSOpenGLPixelFormat/numberOfVirtualScreens)) minus 1.

## 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

[`-  initWithAttributes:`](/documentation/AppKit/NSOpenGLPixelFormat/init(attributes:))

Returns an OpenGL pixel format object initialized with specified pixel format attributes.



---

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)