Inherits From:
NSView : NSResponder : NSObject
Conforms To:
NSCoding
Declared In:
Sc21/SCOpenGLView.h
The main purpose of this class is to be able to use an SCOpenGLPixelFormat in order to be able to archive/unarchive this class. In all other respects, SCOpenGLView behaves like NSOpenGLView.
defaultPixelFormat
Returns a default SCOpenGLPixelFormat.
clearGLContext
Releases the NSOpenGLContext associated with the receiver. If necessary, this method calls clearDrawable on the context before releasing it.
initWithFrame:(NSRect)frameRect
Equivalent to -initWithFrame:frameRect pixelFormat:nil.
initWithFrame:(NSRect)frameRect pixelFormat:(SCOpenGLPixelFormat *)format
Designated initializer.
Initializes a newly allocated NSOpenGLView with frameRect as its frame rectangle and format as its pixelformat.
Passing nil as pixelFormat will result in the pixelformat being
set to the result of +defaultPixelFormat when the OpenGL context
is initialized.
openGLContext
Returns the NSOpenGLContext associated with the receiver. If the
receiver has no associated context, a new NSOpenGLContext is created
and returned. This new context is initialized with the pixelformat
returned by sending pixelFormat to the receiver, or (if this
returns nil) a new pixelformat created by +defaultPixelFormat.
pixelFormat
Returns the pixel format associated with the receiver.
prepareOpenGL
Used by subclassers to initialize OpenGL state. This function is called once after an OpenGL context is created and the drawable is attached.
On Panther, NSOpenGLContext will automatically send this message to
its view from its -makeCurrentContext method.
On Jaguar, this function is called explicitly from our
-openGLContext method, emulating Panther's behavior.
reshape
Called if the visible rectangle or bounds of the receiver change (for scrolling or resize). The default implementation does nothing. Override this method if you need to adjust the viewport and display frustum.
setOpenGLContext:(NSOpenGLContext *)context
Sets the NSOpenGLContext used by the receiver to allow sharing the
same context on a per view basis. Replaces the existing context if
one was already created. You must send setView: to the context to
sync the context with the view.
setPixelFormat:(SCOpenGLPixelFormat *)pixelFormat
Sets the receiver's pixel format to pixelFormat
update
Called if the view's context needs to be updated because the window
moves, or if the view moves or is resized. This method simply calls
NSOpenGLContext's update. Override this method if you need to add
locks for multithreaded access to multiple contexts.