Determining The QuickDraw Version
Determining The QuickDraw Version
Remember that the three varieties of QuickDraw are upwardly compatible:
programs you write for the original QuickDraw run on all varieties of
QuickDraw, and indexed-pixel Color QuickDraw programs run under
direct-pixel systems (although colors may look different-they'll be closer to
what you request). The reverse is not true;
Color QuickDraw uses hard- ware features of the 68020 micro processor
and above, which means it cannot execute on 68000-based machines; in
addition, the original Color QuickDraw does not have the ability to handle
direct pixel values.
By checking at run time to see which version of QuickDraw is available, you
can adapt your program to make best use of the hardware, or at least inform
the user that your program has graphics needs that aren't being met.
(Remember also that this information doesn't matter to many programs; they
use no color, use the original
QuickDraw color system, or, if they use Color QuickDraw, specify only
RGB colors.)
In system software versions 6.0.5 and later you can use the Gestalt
environment selector gestaltQuickDrawVersion to determine which of the
QuickDraw versions is available. Gestalt returns a 4-byte value in the
response parameter; the low-order word contains QuickDraw version data.
In that low-order word, the high-order byte represents the major revision
number and the low-order byte represents the minor revision. The major
revisions currently defined are the original QuickDraw, the
original Color QuickDraw, and Color QuickDraw with direct pixel
capability (which Gestalt calls QD32). See the Compatibility Guidelines for
information on the use of Gestalt.
What Else to Read
The two introductory subjects on Macintosh graphics are the QuickDraw
chapter in Volume I and this overview. Proceed from here according to your
inclination. If your application never uses color or gray scales, you may have
all the information you need. If you use color at all, read the
Color QuickDraw chapter in Volume V and the Color QuickDraw and
Palette Manager chapters in this volume. If your application creates
offscreen bitmaps or pixel maps, you should read the
Graphics Devices Manager chapter in this volume.
If your application needs to offer the user a means of selecting a color, read
about the Color Picker Package
If your application manipulates pixel maps or pictures and needs a means of
determining their contents-for example, what fonts a picture contains, or how
many colors are in a pixel map, read the text about the
Picture Utilities Package.
The Color Manager describes the Color Manager and other low-level
information that most applications seldom need to use. Read that text if you
need to modify the color- matching system used with indexed devices.
If you write graphics drivers or firmware for cards, read the
Slot Manager description and the book Designing Cards and Drivers for the
Macintosh Family, second edition.