To render with OpenGL into an NSOpenGLContext, you must specify the context’s pixel format. An NSOpenGLPixelFormat object specifies the types of buffers and other attributes of the NSOpenGLContext. This class is similar to the AGLPixelFormat type, which is used in Carbon OpenGL applications.


Every NSOpenGLPixelFormat object wraps a low-level, platform-specific Core OpenGL (CGL) pixel format object. Your application can retrieve the CGL pixel format object by calling the cglPixelFormatObj method. For more information on the underling CGL pixel format object, see CGL.


Creating an NSOpenGLPixelFormat Object

init?(cglPixelFormatObj: OpaquePointer)

Returns an NSOpenGLPixelFormatobject initialized with using an existing CGL pixel format object.

init?(attributes: UnsafePointer<NSOpenGLPixelFormatAttribute>)

Returns an NSOpenGLPixelFormat object initialized with specified pixel format attributes.

Managing the Pixel Format

var cglPixelFormatObj: OpaquePointer?

Returns the low-level, platform-specific Core OpenGL (CGL) pixel format object represented by the receiver.

var numberOfVirtualScreens: GLint

Returns the number of virtual screens associated with the receiver.


OpenGL Profiles

Defines constants that specify the functionality provided by the renderer.


Inherits From