Mac Developer Library

Developer

AppKit Framework Reference NSOpenGLLayer Class Reference

Options
Deployment Target:

On This Page
Language:

NSOpenGLLayer

NSOpenGLLayer is a subclass of CAOpenGLLayer that is suitable for rendering OpenGL into layers. Unlike CAOpenGLLayer, NSOpenGLLayer uses distinctly Application Kit types.

Inheritance


Import Statement


import AppKit @import AppKit;

Availability


Available in OS X v10.6 and later.
  • Provides access to the layer's associated NSOpenGLPixelFormat.

    Declaration

    Swift

    var openGLPixelFormat: NSOpenGLPixelFormat!

    Objective-C

    @property(strong) NSOpenGLPixelFormat *openGLPixelFormat

    Discussion

    Subclasses shouldn't invoke setOpenGLPixelFormat:, but can override it if desired to intercept assignment of the layer's pixel format.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.6 and later.

  • Returns the OpenGL pixel format suitable for the specified displays.

    Declaration

    Swift

    func openGLPixelFormatForDisplayMask(_ mask: UInt32) -> NSOpenGLPixelFormat!

    Objective-C

    - (NSOpenGLPixelFormat *)openGLPixelFormatForDisplayMask:(uint32_t)mask

    Parameters

    mask

    A mask specifying the displays the returned NSOpenGLPixelFormat must be suitable for.

    Return Value

    An autoreleased NSOpenGLPixelFormat object suitable for the displays.

    Discussion

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

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.6 and later.

  • view view Property

    Returns the view associated with the layer.

    Declaration

    Swift

    unowned(unsafe) var view: NSView!

    Objective-C

    @property(assign) NSView *view

    Discussion

    Subclasses shouldn't invoke setView:, but can override it if desired to intercept the layer's association to, or dissociation from, a view.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.6 and later.