Mac OS X Reference Library Apple Developer Connection spyglass button

Deprecated AGL Functions

A function identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in Mac OS X v10.5

aglDevicesOfPixelFormat

Returns the graphics devices supported by a pixel format object. (Deprecated in Mac OS X v10.5. Use aglDisplaysOfPixelFormat instead.)

GDHandle * aglDevicesOfPixelFormat (
   AGLPixelFormat pix,
   GLint *ndevs
);
Parameters
pix

A pixel format object.

ndevs

On return, points to the number of devices in the list returned by the function.

Return Value

An array of graphics devices or or NULL if the function fails for any reason. If an error occurs, call the function aglGetError to determine what the error is.

Discussion

You typically use this function after you call the function aglChoosePixelFormat, which can return a list of more than one pixel format object. The first pixel format object in the list is guaranteed to support all of the graphics devices requested of that function.

Availability
See Also
Declared In
agl.h

aglGetDrawable

Returns the drawable object attached to a rendering context. (Deprecated in Mac OS X v10.5.)

AGLDrawable aglGetDrawable (
   AGLContext ctx
);
Parameters
ctx

A rendering context that's attached to a window or a graphics device.

Return Value

The drawable object (either a Carbon window or a full-screen graphics port) that is attached to the rendering context, or NULL for any of the following reasons:

If the function returns NULL, call the function aglGetError to determine what the error is.

Discussion

If the rendering context is a pixel buffer context, call aglGetPBuffer.

Availability
See Also
Declared In
agl.h

aglQueryRendererInfo

Creates and returns a renderer information object that contains properties and values for all renderers driving the specified displays. (Deprecated in Mac OS X v10.5. Instead use aglQueryRendererInfoForCGDirectDisplayIDs.)

AGLRendererInfo aglQueryRendererInfo (
   const AGLDevice *gdevs,
   GLint ndev
);
Parameters
gdevs

A pointer to a list of graphics devices to which you want to restrict the query. Pass NULL to obtain information for all graphics devices on the system.

ndev

The number of graphics devices in gdev. Pass 0 if gdevs is NULL. AGL sets the AGL_BAD_DEVICE error if the ndev parameter is nonzero and the gdevs parameter is not an array of valid devices.

Return Value

A renderer information object that describes all renderers able to drive the devices specified by the gdevs parameter. The function returns NULL if it fails for any reason. If an error occurs, call the function aglGetError to determine what the error is.

Discussion

This function normally returns a list of more than one renderer information object—one for each renderer found on the system. To access data in the first renderer information object tin the list, call the function aglDescribeRenderer. To access data in a renderer information object that is not the first one in the list, use aglNextRendererInfo.

Availability
See Also
Declared In
agl.h

aglSetDrawable

Attaches a rendering context to a Carbon window. (Deprecated in Mac OS X v10.5.)

GLboolean aglSetDrawable (
   AGLContext ctx,
   AGLDrawable draw
);
Parameters
ctx

A rendering context returned by the function aglCreateContext.

draw

The drawable object—which must be a Carbon window—to attach to the AGL rendering context. You need to supply a CGrafPtr data type obtained from a valid window. The Window Manager function GetWindowPort returns the CGrafPtr associated with a Carbon window. To disable rendering for a rendering context, pass NULL.

Return Value

Returns GL_FALSE if it fails for any reason, GL_TRUE otherwise. If an error occurs, call the function aglGetError to determine what the error is.

Discussion

After calling this function, AGL directs subsequent OpenGL rendering calls to the specified rendering context to modify the window content. In addition, the function aglSetDrawable performs all of the actions performed by aglUpdateContext.

When a rendering context is initially attached to the window, its viewport is set to the full size of the window. If the rendering context is subsequently attached to the same window, its viewport is unaltered.

Availability
See Also
Related Sample Code
Declared In
agl.h

aglSurfaceTexture

Allows texturing from a drawable object that has an attached rendering context, using the surface contents as the source data for the texture. (Deprecated in Mac OS X v10.5.)

void aglSurfaceTexture (
   AGLContext context,
   GLenum target,
   GLenum internalformat,
   AGLContext surfacecontext
);
Parameters
context

A rendering context attached to the window that's the target of the texture operation.

target

A constant that specifies an OpenGL target texture. You can supply any of the texture targets defined by the OpenGL specification, including:

  • GL_TEXTURE_2D, a texture whose dimensions are a power of two.

  • GL_TEXTURE_RECTANGLE_EXT, a texture whose dimensions are not a power of two.

  • GL_TEXTURE_CUBE_MAP, a mapped cube texture.

internalformat

A constant that specifies the internal color format of the texture— either GL_RGB or GL_RGBA.

surfacecontext

A rendering context that's attached to the window that's the source of the texture data.

Discussion

The aglSurfaceTexture function behaves similar to the function glTexImage2D. The texture target and internal format must be supported by the renderer of the target rendering context, and the geometry of the source drawable object must be compatible with the texture target. For example, if the texture target is GL_TEXTURE_2D, the window must conform to power-of-two dimensions.

Before calling this function you must use OpenGL calls to set up the OpenGL texture referred to by the target parameter. That is, enable texturing, generate a texture name, bind it to a texture target, and so forth. For more information, see OpenGL Programming Guide.

The target and source windows must use the same renderer (virtual screen) or the function fails, most typically by not texturing the target rendering context.

An error condition occurs if the surface rendering context is not attached to a windowed drawable object; the drawable object cannot be an offscreen area or pixel buffer. It’s also possible to get standard OpenGL errors similar to the errors that can occur for the function glTexImage2D. Use the function glError to query OpenGL errors.

Note: Although the function aglSurfaceTexture provides a flexible way to render to an offscreen texture and then use it as a source, you should consider using pixel buffer objects or OpenGL framebuffer objects instead. For details on using a hidden window as a texture source, see OpenGL Programming Guide for Mac OS X. This document also describes how to use pixel buffer objects and framebuffer objects as texture sources.

Availability
Related Sample Code
Declared In
agl.h

aglUseFont

Creates bitmap display lists from a font. (Deprecated in Mac OS X v10.5.)

GLboolean aglUseFont (
   AGLContext ctx,
   GLint fontID,
   Style face,
   GLint size,
   GLint first,
   GLint count,
   GLint base
);
Parameters
ctx

A rendering context.

fontID

The font ID associated with the font whose character glyphs you want to use. The fontID value can identify any font family that is valid for passing into the TextFont function.

face

The font style. The face value can be any valid style that can be passed into the TextFace function.

size

The font size.

first

The index of the first glyph to use.

count

The number of glyphs to use.

base

The index of the first display list to generate.

Return Value

Returns GL_FALSE if it fails for any reason, GL_TRUE otherwise. If an error occurs, call the function aglGetError to determine what the error is.

Discussion

A display list contains one or more OpenGL commands that are stored and available to be executed later by your application. The aglUseFont function generates a set of display lists, each of which contains a single call to the OpenGL glBitmap function. AGL generates names for each display list by using the value specified in the base parameter and increasing sequentially to base + count – 1.

The prototype for the glBitmap function is :

void glBitmap(GLsizei width,
            GLsizei height,
            GLfloat xorig,
            GLfloat yorig,
            GLfloat xmove,
            GLfloat ymove,
            const GLubyte *bitmap)
 

AGL generates parameters for each glBitmap command in each display list using the following rules:

AGL creates empty display lists for all glyphs that you request and that are not defined in the font. For current fonts, see the file fonts.h.

For more information on the glBitmap function see the OpenGL Reference Manual. You might also want to look at the glNewList function, which is the function that AGL uses to generate the display lists.

Availability
Declared In
agl.h


Last updated: 2007-10-31

Did this document help you? Yes It's good, but... Not helpful...