Apple IIgs #72
QuickDraw II Quirks

Revised by Dave Lyons (May 1992)
Written by Dave Lyons & C. K. Haun <TR> (November 1989)

This Technical Note points out some things things you need to watch out for when using QuickDraw II, especially with FastPort-aware and Shadowing modes.

Changes since November 1990: Removed some obsolete information on ScrollRect and on shadowing. Noted that DrawPicture in 6.0 is now compatible with FastPort mode. Added a warning about making QuickDraw II calls while QuickDraw II is not started.

Don't Call QuickDraw II While It's Inactive

Most QuickDraw II functions behave unpredictably if you call them while QuickDraw II is inactive, so watch it! Don't make QuickDraw II calls while QuickDraw II isn't started, except as documented. GrafOn and GrafOff are okay. (And so are QDStartUp, QDVersion, and QDStatus.)

FastPort-Aware Anomaly

Before System 6.0, when the FastPort-aware bit is turned on in the MasterSCB parameter to QDStartUp, DrawPicture did not notice changes in the pen pattern. If your application does not require 6.0 and uses pictures, either directly or indirectly (i.e., by printing to the ImageWriter driver), you may need to leave FastPort-aware mode turned off to get the expected behavior.

FastFont and Large Pixel Maps

FastFont does not work correctly when drawing past the first 64K of a pixel map. If you are drawing text that uses FastFont (i.e., Shaston 8), you can avoid this problem by using a non-rectangular clipRgn.

Don't ShowPen while Collecting Polygons, Regions, or Pictures

The Macintosh QuickDraw documentation permits calling ShowPen after an OpenPoly, OpenRgn, or OpenPicture call to cause drawing calls to contribute to a polygon, region, or picture AND draw to a pixel map at the same time.

The Apple IIgs QuickDraw II documentation does not say you can do that. In some cases, it works, but it works "by accident" and it's not one of the things Apple tests or guarantees in QuickDraw II.

You May Need SetBufDims!

The call description for SetBufDims on page 16-215 of Volume 2 of the Toolbox Reference is misleading. The note in the description states, "You only need to make this call if your application is going to use, or allow the user to choose, fonts that have unusually large values of chExtra and spExtra." This is not true; you need to call SetBufDims to adjust the clipping buffers for your application if you plan to use a clipRgn that has a greater width than the width you passed at QDStartUp.

SetBufDims sets the clipping buffer width as well as that of the text buffer, so if you plan to use a clipping region larger than the startup port width you must use SetBufDims.

Be aware that this call may be necessary even if your application does not ever set a clipping region or rectangle. Some toolbox calls assume that the clipping buffer size is correct based on the parameters passed to that routine. For example, if the locInfo you pass to CopyPixels has a width parameter that is wider than the width you passed at QDStartUp, CopyPixels may fail. A safe rule of thumb is to make sure (possibly by setting) that the width parameter in the buffer dimensions is the same or greater than the widest width in the locInfo structures passed to routines that use them.

Further Reference

This and all of the other Apple II Technical Notes have been converted to HTML by Aaron Heiss as a public service to the Apple II community, with permission by Apple Computer, Inc. Any and all trademarks, registered and otherwise, are properties of their owners.