O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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;

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required