Important: The information in this document is obsolete and should not be used for new development.
InitGDevice
TheNewGDevice
function uses theInitGDevice
procedure to initialize aGDevice
record.
PROCEDURE InitGDevice (gdRefNum: Integer; mode: LongInt; gdh: GDHandle);
gdRefNum
- Reference number of the graphics device. System software sets this number at system startup time for most graphics devices.
mode
- The device configuration mode. Used by the screen driver, this value sets the pixel depth and specifies color or black and white.
gdh
- The handle, returned by the
NewGDevice
function, to theGDevice
record to be initialized.DESCRIPTION
TheInitGDevice
procedure initializes theGDevice
record specified in thegdh
parameter. TheInitGDevice
procedure sets the graphics device whose driver has the reference number specified in thegdRefNum
parameter to the mode specified in themode
parameter. TheInitGDevice
procedure then fills out theGDevice
record, previously created with theNewGDevice
function, to contain all information describing that mode.The
mode
parameter determines the configuration of the device; possible modes for a device can be determined by interrogating the video device's ROM through Slot Manager routines. The information describing the device's mode is primarily contained in the video device's ROM. If the video device has a fixed color table, then that table is read directly from the ROM. If the video device has a variable color table, thenInitGDevice
uses the default color table defined in a'clut'
resource, contained in the System file, that has a resource ID equal to the video device's pixel depth.In general, your application should never need to call
InitGDevice
. All video devices are initialized at start time, and users change modes through the Monitors control panel.SPECIAL CONSIDERATIONS
If your program usesNewGDevice
to create a graphics device without a driver,InitGDevice
does nothing; instead, your application must initialize all fields of theGDevice
record. After your application initializes the color table for theGDevice
record, your application should call the Color Manager procedureMakeITable
to build the inverse table for the graphics device.The
InitGDevice
procedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.SEE ALSO
TheGDevice
record is described on page 5-14. See Designing Cards and Drivers for the Macintosh Family, third edition, for more information about the device modes that you can specify in themode
parameter. TheMakeITable
procedure is described in the chapter "Color Manager" in Advanced Color Imaging on the Mac OS.