Writing Compatible Graphics Applications
Writing Compatible Graphics Applications
Over the years, some developers have written applications that modify the
QuickDraw data structures directly, rather than using the routines
provided for that purpose. Then, when engineers at Apple improve
QuickDraw, the applications break. As QuickDraw, graphics applications,
and cards such as graphics accelerators grow more complex, the problem
becomes acute. This section points to new routines you can use to signal
QuickDraw when your application modifies certain data structures directly
so that QuickDraw can take note and act accordingly.
Applications should not directly change fields in graphics data structures, but
should use the following routines instead:
BackColor MovePortTo SetDeviceAttribute
BackPixPat ObscureCursor SetOrigin
ColorBit PenNormal SetPortBits
DelComp PenPixPat ShowCursor
GrafDevice RGBBackColor TextFace
HideCursor RGBForeColor TextFont
HiliteColor SetClientID TextSize
Using these routines rather than directly modifying the data structures
ensures that your application will fully benefit from any future improvements
to QuickDraw. In particular, the off-screen graphics world routines
described in the Graphics Devices Manager remove much of the need for
directly modifying graphics data structures.
Apple strongly recommends that new applications follow these guidelines;
asynchronously operating graphics cards especially need close co operation
with QuickDraw.
It is possible to make existing applications more compatible by calling one of
the following procedures after directly changing a QuickDraw data structure
and before calling any other QuickDraw routine:
These procedures inform QuickDraw that a direct modification has occurred
so it can update its tracking of the graphics environment.