Class

NSOpenGLView

A view that displays OpenGL content in a view.

Declaration

@interface NSOpenGLView : NSView

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.

Topics

Initializing an NSOpenGLView

- initWithFrame:pixelFormat:

Returns an NSOpenGLView object initialized with the specified frame rectangle and pixel format.

Managing the NSOpenGLPixelFormat

pixelFormat

The NSOpenGLPixelFormat object associated with the receiver.

Managing the NSOpenGLContext

- prepareOpenGL

Used by subclasses to initialize OpenGL state.

- clearGLContext

Releases the NSOpenGLContext object associated with the view.

openGLContext

The NSOpenGLContext object associated with the receiver.

Managing the Visible Region

- reshape

Called by Cocoa when the view's visible rectangle or bounds change.

- update

Called by Cocoa when the view’s window moves or when the view itself moves or is resized.

Displaying

- isOpaque

Returns a Boolean value that indicates whether the view is opaque.

Extended Dynamic Range

wantsExtendedDynamicRangeOpenGLSurface

Enables extended dynamic range values on the screen.

Relationships

Inherits From

See Also

Content Views

Browser View

Provide a column-based interface for viewing and navigating hierarchical information.

Collection View

Display one or more subviews in a highly configurable arrangement.

Outline View

Display a list-based interface for hierarchical data, where each level of hierarchy is indented from the previous one.

Table View

Display custom data in rows and columns.

NSTextView

A view that draws text and handles user interactions with that text.