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 theHasDepthfunction.
FUNCTION HasDepth (aDevice: GDHandle; depth: Integer; whichFlags: Integer; flags: Integer): Integer;
aDevice- A handle to the
GDevicerecord of the video device.depth- The pixel depth for which you're testing.
whichFlags
ThegdDevTypeconstant, which represents a bit in thegdFlagsfield of theGDevicerecord. (If this bit is set to 0 in theGDevicerecord, 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
HasDepthfunction tests whether the video device is black and white; if you pass 1 in this parameter,HasDepthtests whether the video device supports color.DESCRIPTION
TheHasDepthfunction checks whether the video device you specify in theaDeviceparameter supports the pixel depth you specify in thedepthparameter, and whether the device is black and white or color, whichever you specify in theflagsparameter.The
HasDepthfunction returns 0 if the device does not support the depth you specify in thedepthparameter or the display mode you specify in theflagsparameter.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
depthparameter for theSetDepthfunction (described next) to set the graphics device to the pixel depth and display mode for which you tested.SPECIAL CONSIDERATIONS
TheHasDepthfunction 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.