<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNView/openGLContext",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNView(py)openGLContext"
  },
  "title" : "openGLContext"
}
-->

# openGLContext

The OpenGL context that the view uses to render its contents.

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

## Discussion

If you use OpenGL for custom rendering (see the [`SCNShadable`](/documentation/SceneKit/SCNShadable), [`SCNNodeRendererDelegate`](/documentation/SceneKit/SCNNodeRendererDelegate), and [`SCNSceneRendererDelegate`](/documentation/SceneKit/SCNSceneRendererDelegate) protocols), you can use this property to share OpenGL resources between the context used for rendering the scene and other OpenGL contexts your app uses. For details on sharing OpenGL resources, see [Sharing Rendering Context Resources](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_contexts/opengl_contexts.html#//apple_ref/doc/uid/TP40001987-CH216-SW7). (SceneKit automatically shares its own OpenGL resources between multiple [`SCNView`](/documentation/SceneKit/SCNView) instances in your app as needed.)

---

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)