---
title: openGLContext
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsopengllayer/openglcontext
---

# openGLContext

The layer’s OpenGL context.

## Declaration

```swift
var openGLContext: NSOpenGLContext? { get set }
```

## Discussion

Discussion Provides access to the layer’s associated NSOpenGLContext.  Subclasses shouldn’t invoke setOpenGLContext:, but can override it if desired to intercept assignment of the layer’s context.

## See Also

### Managing the Rendering Context

- [openGLContext(for:)](appkit/nsopengllayer/openglcontext(for:).md)
