Mac Developer Library

Developer

ApplicationServices Framework Reference CGGLContext Reference

Options
Deployment Target:

On This Page

CGGLContext Reference

The CGGLContext header file defines functions that create and update a graphics context for OpenGL drawing. A CGGLContext context is a type of CGContextRef that is used for OpenGL content. However, its use is not recommended.

Functions

  • Creates a Quartz graphics context from an OpenGL context.

    Declaration

    Objective-C

    CGContextRef CGGLContextCreate ( void *glContext, CGSize size, CGColorSpaceRef colorspace );

    Parameters

    glContext

    The context that the OpenGL system uses to manage OpenGL drawing.

    size

    The dimensions of the OpenGL viewport rectangle.

    colorspace

    An RGB color space that serves as the destination space when rendering device-independent colors. If NULL, Quartz uses the default RGB color space. Quartz retains the color space you pass in; on return, you may safely release it.

    Return Value

    A new Quartz graphics context. You are responsible for releasing this object by calling CGContextRelease.

    Discussion

    The use of this function is not recommended.

    Creates a Quartz context from the OpenGL context glContext. The context establishes an OpenGL viewport rectangle with dimensions specified by the size parameter by calling glViewport(3G). If non-NULL, the colorspace parameter should be an RGB profile that specifies the destination space when rendering device-independent colors.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Availability

    Available in OS X version 10.3 and later.

    Deprecated in OS X v10.6.

  • Updates the size of the viewport associated with an OpenGL context.

    Declaration

    Objective-C

    void CGGLContextUpdateViewportSize ( CGContextRef c, CGSize size );

    Parameters

    context

    A Quartz graphics context obtained by calling CGGLContextCreate.

    size

    The new dimensions of the OpenGL viewport.

    Discussion

    The use of this function is not recommended.

    You should call this function whenever the size of the associated OpenGL context changes.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Availability

    Available in OS X version 10.3 and later.

    Deprecated in OS X v10.6.