---
title: NSOpenGLView
framework: appkit
role: symbol
role_heading: Class
path: appkit/nsopenglview
---

# NSOpenGLView

A view that displays OpenGL content in a view.

## Declaration

```swift
class NSOpenGLView
```

## Overview

Overview An NSOpenGLView object maintains an NSOpenGLPixelFormat and NSOpenGLContext object into which OpenGL calls can be rendered. The view provides methods for accessing and managing the NSOpenGLPixelFormat and NSOpenGLContext objects, as well as notifications of visible region changes. An NSOpenGLView object cannot have subviews. You can, however, divide a single NSOpenGLView into multiple rendering areas using the glViewport function. When creating an NSOpenGLView object in Interface Builder, you use the inspector window to specify the pixel format attributes you want for the view. Only those attributes listed in the Interface Builder inspector are set when the view is instantiated. note: In versions of the Xcode Tools that shipped prior to OS X v10.4, the Interface Builder inspector does not list any pixel format attributes for NSOpenGLView.

## Topics

### Initializing an NSOpenGLView

- [init(frame:pixelFormat:)](appkit/nsopenglview/init(frame:pixelformat:).md)

### Managing the NSOpenGLPixelFormat

- [defaultPixelFormat()](appkit/nsopenglview/defaultpixelformat().md)
- [pixelFormat](appkit/nsopenglview/pixelformat.md)

### Managing the NSOpenGLContext

- [prepareOpenGL()](appkit/nsopenglview/prepareopengl().md)
- [clearGLContext()](appkit/nsopenglview/clearglcontext().md)
- [openGLContext](appkit/nsopenglview/openglcontext.md)

### Managing the Visible Region

- [reshape()](appkit/nsopenglview/reshape().md)
- [update()](appkit/nsopenglview/update().md)

### Extended Dynamic Range

- [wantsExtendedDynamicRangeOpenGLSurface](appkit/nsopenglview/wantsextendeddynamicrangeopenglsurface.md)

### Instance Properties

- [wantsBestResolutionOpenGLSurface](appkit/nsopenglview/wantsbestresolutionopenglsurface.md)
- [wantsExtendedDynamicRangeOpenGLSurface](appkit/nsopenglview/wantsextendeddynamicrangeopenglsurface.md)

## Relationships

### Inherits From

- [NSView](appkit/nsview.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSAccessibilityElementProtocol](appkit/nsaccessibilityelementprotocol.md)
- [NSAccessibilityProtocol](appkit/nsaccessibilityprotocol.md)
- [NSAnimatablePropertyContainer](appkit/nsanimatablepropertycontainer.md)
- [NSAppearanceCustomization](appkit/nsappearancecustomization.md)
- [NSCoding](foundation/nscoding.md)
- [NSDraggingDestination](appkit/nsdraggingdestination.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSStandardKeyBindingResponding](appkit/nsstandardkeybindingresponding.md)
- [NSTouchBarProvider](appkit/nstouchbarprovider.md)
- [NSUserActivityRestoring](appkit/nsuseractivityrestoring.md)
- [NSUserInterfaceItemIdentification](appkit/nsuserinterfaceitemidentification.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Classes

- [NSOpenGLContext](appkit/nsopenglcontext.md)
- [NSOpenGLLayer](appkit/nsopengllayer.md)
- [NSOpenGLPixelFormat](appkit/nsopenglpixelformat.md)
- [NSDrawer](appkit/nsdrawer.md)
- [NSForm](appkit/nsform.md)
- [NSFormCell](appkit/nsformcell.md)
- [NSMenuItemCell](appkit/nsmenuitemcell.md)
