Important: The information in this document is obsolete and should not be used for new development.
MyDrawingProc
Here's how to declare a drawing procedure to supply to theDeviceLoopprocedure if you were to name the procedureMyDrawingProc:
PROCEDURE MyDrawingProc (depth: Integer; deviceFlags: Integer; targetDevice: GDHandle; userData: LongInt);
depth- The pixel depth of the graphics device.
deviceFlags- Any of the following constants, which represent bits that are set to 1 in the
gdFlagsfield of theGDevicerecord (described on page 5-14) for the current device:CONST {flag bits for gdFlags field of GDevice record} gdDevType = 0; {if bit is set to 1, graphics } { device supports color} burstDevice = 7; {if bit is set to 1, device } { supports block transfer} ext32Device = 8; {if bit is set to 1, device } { must be used in 32-bit mode} ramInit = 10; {if bit is set to 1, device has } { been initialized from RAM} mainScreen = 11; {if bit is set to 1, device is } { the main screen} allInit = 12; {if bit is set to 1, all } { devices were initialized from } { 'scrn' resource} screenDevice = 13; {if bit is set to 1, device is } { a screen} noDriver = 14; {if bit is set to 1, GDevice } { record has no driver} screenActive = 15; {if bit is set to 1, device is } { active}
targetDevice- A handle to the
GDevicerecord (described on page 5-14) for the current device.userData- A value that your application supplies to the
DeviceLoopprocedure, which in turn passes the value to your drawing procedure for whatever purpose you deem useful.DESCRIPTION
Your drawing procedure should analyze the pixel depth passed in thedepthparameter and the values passed in thedeviceFlagsparameter, and then draw in a manner that is optimized for the current device.SEE ALSO
Listing 5-2 on page 5-8 illustrates a simple drawing procedure called byDeviceLoop.