Next Page > Hide TOC

CGGLContext Reference

Derived from
Framework
ApplicationServices/ApplicationServices.h
Companion guide
Declared in
CGGLContext.h

Overview

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

CGGLContextCreate

Creates a Quartz graphics context from an OpenGL context.

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.

Availability
Declared In
CGGLContext.h

CGGLContextUpdateViewportSize

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

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.

Availability
Declared In
CGGLContext.h

Next Page > Hide TOC


© 2003, 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-12-22)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.