Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 5 - Graphics Devices / Graphics Devices Reference
Application-Defined Routine /


MyDrawingProc

Here's how to declare a drawing procedure to supply to the DeviceLoop procedure if you were to name the procedure MyDrawingProc:

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 gdFlags field of the GDevice record (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 GDevice record (described on page 5-14) for the current device.
userData
A value that your application supplies to the DeviceLoop procedure, 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 the depth parameter and the values passed in the deviceFlags parameter, 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 by DeviceLoop.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996