A function identified as deprecated has been superseded and may become unsupported in the future.
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 );
A pixel format object.
On return, points to the number of devices in the list returned by the function.
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.
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.
agl.hReturns the drawable object attached to a rendering context. (Deprecated in Mac OS X v10.5.)
AGLDrawable aglGetDrawable ( AGLContext ctx );
A rendering context that's attached to a window or a graphics device.
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:
No drawable object is attached.
A pixel buffer or offscreen memory area is attached.
The function fails for any reason.
If the function returns NULL, call the function aglGetError to determine what the error is.
If the rendering context is a pixel buffer context, call aglGetPBuffer.
agl.hCreates 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 );
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.
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.
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.
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.
agl.hAttaches a rendering context to a Carbon window. (Deprecated in Mac OS X v10.5.)
GLboolean aglSetDrawable ( AGLContext ctx, AGLDrawable draw );
A rendering context returned by the function aglCreateContext.
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.
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.
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.
agl.hAllows 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 );
A rendering context attached to the window that's the target of the texture operation.
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.
A constant that specifies the internal color format of the texture— either GL_RGB or GL_RGBA.
A rendering context that's attached to the window that's the source of the texture data.
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.
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.agl.hCreates 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 );
A rendering context.
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.
The font style. The face value can be any valid style that can be passed into the TextFace function.
The font size.
The index of the first glyph to use.
The number of glyphs to use.
The index of the first display list to generate.
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.
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:
The formatting parameters—xorig, yorig, width, and height—are computed from the font metrics provided in the font as 0, font descent – 1, font width, and font ascent + descent, respectively.
The xmove parameter based on the width metric of the glyph.
The ymove is set to 0.
The glyph image is converted to the appropriate format for the bitmap parameter.
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.
agl.hLast updated: 2007-10-31