ADC Home > Reference Library > Technical Q&As > Legacy Documents > Graphics & Imaging >
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
do I correctly set up and
GLboolean aglSetDrawable (AGLContext context, AGLDrawable drawable);- where context is a valid context return from
drawable is an
The following example code can be used, on Mac OS 9 without Carbon and on Mac OS 9 and Mac OS X with Carbon, to ensure the proper type is passed to the
#if TARGET_API_MAC_CARBON aglSetDrawable (context, GetWindowPort (pWindow)); #else aglSetDrawable (context, (AGLDrawable) pWindow); #endif // TARGET_API_MAC_CARBON
Q. What about DrawSprocket's front buffer? Isn't that really just a
A. Not really, DrawSprocket's front buffer is a non-standard
Q. So I've done all this and my application is still crashing on the call to
A. If you're using pre-compiled headers such as
#define GetWindowPort(w) ((CGrafPtr) (w))This results in a simple cast which does not work with Carbon's opaque data structures. To avoid this problem ensure you are using the correct pre-compiled headers for the environment you are building.