Instance Method

initWithCGLContextObj:

Initializes and returns a NSOpenGLContext object using an existing CGL context.

Declaration

- (NSOpenGLContext *)initWithCGLContextObj:(CGLContextObj)context;

Parameters

context

The CGL context to wrap inside the NSOpenGLContext object.

Return Value

An initialized context.

Discussion

If your application already has a CGL context, you can wrap a NSOpenGLContext object around it using this method. This method retains the CGL context by calling CGLRetainContext.

Only one NSOpenGLContext object can wrap a specific context.

Your application should not call CGLDestroyContext to dispose of the CGL context. Instead, your application should call CGLReleaseContext to decrement its reference count.

See Also

Context Creation

- initWithFormat:shareContext:

Returns an NSOpenGLContext object initialized with the specified pixel format information.

Deprecated