Name

NSOpenGLContext — Mac OS X 10.0

Synopsis

This class provides an interface to objects that are responsible for interpreting and rendering calls to the OpenGL API. NSOpenGLContext supports rendering on the full screen (as would be done in a game), off-screen, or into an instance of NSOpenGLView (which might be useful for data visualization applications).

image with no caption

@interface NSOpenGLContext : NSObject
                                  // Initializers
   - (id)initWithFormat:(NSOpenGLPixelFormat *)format 
                                 shareContext:(NSOpenGLContext *)share;
                                  // Accessor Methods
   - (void)setCurrentVirtualScreen:(int)screen;
   - (int)currentVirtualScreen;
   - (void)setFullScreen;
   - (void)setOffScreen:(void *)baseaddr 
                                 width:(long)width 
                                 height:(long)height 
                                 rowbytes:(long)rowbytes;
   - (void)setValues:(const long *)vals 
                                 forParameter:(NSOpenGLContextParameter)param;
   - (void)setView:(NSView *)view;
   - (NSView *)view;
                                  // Class Methods
   + (void)clearCurrentContext;
   + (NSOpenGLContext *)currentContext;
                                  // Instance Methods
   - (void)createTexture:(unsigned long/*GLenum*/)target 
                                 fromView:(NSView*)view
                                 internalFormat:(unsigned long/*GLenum*/)format;
   - (void)clearDrawable;
   - (void)copyAttributesFromContext:(NSOpenGLContext *)context 
                                 withMask:(unsigned long)mask;
   - (void)flushBuffer;
   - (void)getValues:(long *)vals 
                                 forParameter:(NSOpenGLContextParameter)param;
   - (void)makeCurrentContext;
   - (void)update;

Get Cocoa in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.