<!--
{
  "documentType" : "article",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/opengl-pixel-format-attributes",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "OpenGL Pixel Format Attributes"
}
-->

# OpenGL Pixel Format Attributes

Pixel format attributes for OpenGL.

## Topics

### Constants

[`NSOpenGLPFAAccelerated`](/documentation/AppKit/NSOpenGLPFAAccelerated)

A Boolean attribute. If present, this attribute indicates that only hardware-accelerated renderers are considered. If not present, accelerated renderers are still preferred.

[`NSOpenGLPFAAcceleratedCompute`](/documentation/AppKit/NSOpenGLPFAAcceleratedCompute)

If present, this attribute indicates that only renderers that can execute OpenCL programs should be used.

[`NSOpenGLPFAAccumSize`](/documentation/AppKit/NSOpenGLPFAAccumSize)

Value is a nonnegative buffer size specification. An accumulation buffer that most closely matches the specified size is preferred.

[`NSOpenGLPFAAllRenderers`](/documentation/AppKit/NSOpenGLPFAAllRenderers)

A Boolean attribute. If present, this attribute indicates that the pixel format selection is open to all available renderers, including debug and special-purpose renderers that are not OpenGL compliant.

[`NSOpenGLPFAAllowOfflineRenderers`](/documentation/AppKit/NSOpenGLPFAAllowOfflineRenderers)

A Boolean attribute. If present, this attribute indicates that offline renderers may be used.

[`NSOpenGLPFAAlphaSize`](/documentation/AppKit/NSOpenGLPFAAlphaSize)

Value is a nonnegative buffer size specification. An alpha buffer that most closely matches the specified size is preferred.

[`NSOpenGLPFAAuxBuffers`](/documentation/AppKit/NSOpenGLPFAAuxBuffers)

Value is a nonnegative integer that indicates the desired number of auxiliary buffers. Pixel formats with the smallest number of auxiliary buffers that meets or exceeds the specified number are preferred.

[`NSOpenGLPFAAuxDepthStencil`](/documentation/AppKit/NSOpenGLPFAAuxDepthStencil)

Each auxiliary buffer has its own depth stencil.

[`NSOpenGLPFABackingStore`](/documentation/AppKit/NSOpenGLPFABackingStore)

A Boolean attribute. If present, this attribute indicates that OpenGL only considers renderers that have a back color buffer the full size of the drawable (regardless of window visibility) and that guarantee the back buffer contents to be valid after a call to `NSOpenGLContext` object’s [`flushBuffer()`](/documentation/AppKit/NSOpenGLContext/flushBuffer()).

[`NSOpenGLPFAClosestPolicy`](/documentation/AppKit/NSOpenGLPFAClosestPolicy)

A Boolean attribute. If present, this attribute indicates that the pixel format choosing policy is altered for the color buffer such that the buffer closest to the requested size is preferred, regardless of the actual color buffer depth of the supported graphics device.

[`NSOpenGLPFAColorFloat`](/documentation/AppKit/NSOpenGLPFAColorFloat)

[`NSOpenGLPFAColorSize`](/documentation/AppKit/NSOpenGLPFAColorSize)

Value is a nonnegative buffer size specification. A color buffer that most closely matches the specified size is preferred. If unspecified, OpenGL chooses a color size that matches the screen.

[`NSOpenGLPFACompliant`](/documentation/AppKit/NSOpenGLPFACompliant)

A Boolean attribute. If present, this attribute indicates that pixel format selection is only open to OpenGL-compliant renderers. This attribute is implied unless `NSOpenGLPFAAllRenderers` is specified. This attribute is not useful in the attribute array.

[`NSOpenGLPFADepthSize`](/documentation/AppKit/NSOpenGLPFADepthSize)

Value is a nonnegative depth buffer size specification. A depth buffer that most closely matches the specified size is preferred.

[`NSOpenGLPFADoubleBuffer`](/documentation/AppKit/NSOpenGLPFADoubleBuffer)

A Boolean attribute. If present, this attribute indicates that only double-buffered pixel formats are considered. Otherwise, only single-buffered pixel formats are considered.

[`NSOpenGLPFAFullScreen`](/documentation/AppKit/NSOpenGLPFAFullScreen)

A Boolean attribute. If present, this attribute indicates that only renderers that are capable of rendering to a full-screen drawable are considered. The `NSOpenGLPFASingleRenderer` attribute is implied.

[`NSOpenGLPFAMPSafe`](/documentation/AppKit/NSOpenGLPFAMPSafe)

A Boolean attribute. If present, this attribute indicates that the renderer is multi-processor safe.

[`NSOpenGLPFAMaximumPolicy`](/documentation/AppKit/NSOpenGLPFAMaximumPolicy)

A Boolean attribute. If present, this attribute indicates that the pixel format choosing policy is altered for the color, depth, and accumulation buffers such that, if a nonzero buffer size is requested, the largest available buffer is preferred.

[`NSOpenGLPFAMinimumPolicy`](/documentation/AppKit/NSOpenGLPFAMinimumPolicy)

A Boolean attribute. If present, this attribute indicates that the pixel format choosing policy is altered for the color, depth, and accumulation buffers such that only buffers of size greater than or equal to the desired size are considered.

[`NSOpenGLPFAMultiScreen`](/documentation/AppKit/NSOpenGLPFAMultiScreen)

A Boolean attribute. If present, this attribute indicates that only renderers capable of driving multiple screens are considered. This attribute is not generally useful.

[`NSOpenGLPFAMultisample`](/documentation/AppKit/NSOpenGLPFAMultisample)

[`NSOpenGLPFANoRecovery`](/documentation/AppKit/NSOpenGLPFANoRecovery)

[`NSOpenGLPFAOffScreen`](/documentation/AppKit/NSOpenGLPFAOffScreen)

A Boolean attribute. If present, this attribute indicates that only renderers that are capable of rendering to an offscreen memory area and have buffer depth exactly equal to the desired buffer depth are considered. The `NSOpenGLPFAClosestPolicy` attribute is implied.

[`NSOpenGLPFAOpenGLProfile`](/documentation/AppKit/NSOpenGLPFAOpenGLProfile)

A constant that represents an OpenGL profile.

[`NSOpenGLPFAPixelBuffer`](/documentation/AppKit/NSOpenGLPFAPixelBuffer)

A Boolean attribute. If present, this attribute indicates that rendering to a pixel buffer is enabled.

[`NSOpenGLPFARemotePixelBuffer`](/documentation/AppKit/NSOpenGLPFARemotePixelBuffer)

A Boolean attribute. If present, this attribute indicates that rendering to a pixel buffer on an offline renderer is enabled.

[`NSOpenGLPFARendererID`](/documentation/AppKit/NSOpenGLPFARendererID)

[`NSOpenGLPFARobust`](/documentation/AppKit/NSOpenGLPFARobust)

A Boolean attribute. If present, this attribute indicates that only renderers that do not have any failure modes associated with a lack of video card resources are considered. This attribute is not generally useful.

[`NSOpenGLPFASampleAlpha`](/documentation/AppKit/NSOpenGLPFASampleAlpha)

A Boolean attribute. If present and used with [`NSOpenGLPFASampleBuffers`](/documentation/AppKit/NSOpenGLPFASampleBuffers) and [`NSOpenGLPFASampleBuffers`](/documentation/AppKit/NSOpenGLPFASampleBuffers), this attribute hints to OpenGL to update multi-sample alpha values to ensure the most accurate rendering. If pixel format is not requesting antialiasing then this hint does nothing.

[`NSOpenGLPFASampleBuffers`](/documentation/AppKit/NSOpenGLPFASampleBuffers)

Value is a nonnegative number indicating the number of multisample buffers.

[`NSOpenGLPFASamples`](/documentation/AppKit/NSOpenGLPFASamples)

Value is a nonnegative indicating the number of samples per multisample buffer.

[`NSOpenGLPFAScreenMask`](/documentation/AppKit/NSOpenGLPFAScreenMask)

[`NSOpenGLPFASingleRenderer`](/documentation/AppKit/NSOpenGLPFASingleRenderer)

[`NSOpenGLPFAStencilSize`](/documentation/AppKit/NSOpenGLPFAStencilSize)

Value is a nonnegative integer that indicates the desired number of stencil bitplanes. The smallest stencil buffer of at least the specified size is preferred.

[`NSOpenGLPFAStereo`](/documentation/AppKit/NSOpenGLPFAStereo)

A Boolean attribute. If present, this attribute indicates that only stereo pixel formats are considered. Otherwise, only monoscopic pixel formats are considered.

[`NSOpenGLPFASupersample`](/documentation/AppKit/NSOpenGLPFASupersample)

[`NSOpenGLPFATripleBuffer`](/documentation/AppKit/NSOpenGLPFATripleBuffer)

A Boolean attribute. If present, this attribute indicates that only triple-buffered pixel formats are considered. Otherwise, only single-buffered pixel formats are considered.

[`NSOpenGLPFAVirtualScreenCount`](/documentation/AppKit/NSOpenGLPFAVirtualScreenCount)

The number of virtual screens in this format.

[`NSOpenGLPFAWindow`](/documentation/AppKit/NSOpenGLPFAWindow)

A Boolean attribute. If present, this attribute indicates that only renderers that are capable of rendering to a window are considered. This attribute is implied if neither `NSOpenGLPFAFullScreen` nor `NSOpenGLPFAOffScreen` is specified.



---

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)