Important: The information in this document is obsolete and should not be used for new development.
HasDepth
To determine whether a video device supports a specific pixel depth, you can use theHasDepth
function.
FUNCTION HasDepth (aDevice: GDHandle; depth: Integer; whichFlags: Integer; flags: Integer): Integer;
aDevice
- A handle to the
GDevice
record of the video device.depth
- The pixel depth for which you're testing.
whichFlags
ThegdDevType
constant, which represents a bit in thegdFlags
field of theGDevice
record. (If this bit is set to 0 in theGDevice
record, the video device is black and white; if the bit is set to 1, the device supports color.)flags
- The value 0 or 1. If you pass 0 in this parameter, the
HasDepth
function tests whether the video device is black and white; if you pass 1 in this parameter,HasDepth
tests whether the video device supports color.DESCRIPTION
TheHasDepth
function checks whether the video device you specify in theaDevice
parameter supports the pixel depth you specify in thedepth
parameter, and whether the device is black and white or color, whichever you specify in theflags
parameter.The
HasDepth
function returns 0 if the device does not support the depth you specify in thedepth
parameter or the display mode you specify in theflags
parameter.Any other value indicates that the device supports the specified depth and display mode. The function result contains the mode ID that QuickDraw passes to the video driver to set its pixel depth and to specify color or black and white. You can pass this mode ID in the
depth
parameter for theSetDepth
function (described next) to set the graphics device to the pixel depth and display mode for which you tested.SPECIAL CONSIDERATIONS
TheHasDepth
function may move or purge blocks of memory in the application heap. Your application should not call this function at interrupt time.SEE ALSO
See Designing Cards and Drivers for the Macintosh Family, third edition, for more information about the device modes returned as a function result forHasDepth
.