Important: The information in this document is obsolete and should not be used for new development.
NewGDevicefunction uses the
InitGDeviceprocedure to initialize a
PROCEDURE InitGDevice (gdRefNum: Integer; mode: LongInt; gdh: GDHandle);
- Reference number of the graphics device. System software sets this number at system startup time for most graphics devices.
- The device configuration mode. Used by the screen driver, this value sets the pixel depth and specifies color or black and white.
- The handle, returned by the
NewGDevicefunction, to the
GDevicerecord to be initialized.
InitGDeviceprocedure initializes the
GDevicerecord specified in the
InitGDeviceprocedure sets the graphics device whose driver has the reference number specified in the
gdRefNumparameter to the mode specified in the
InitGDeviceprocedure then fills out the
GDevicerecord, previously created with the
NewGDevicefunction, to contain all information describing that mode.
modeparameter 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, then
InitGDeviceuses 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 CONSIDERATIONSIf your program uses
NewGDeviceto create a graphics device without a driver,
InitGDevicedoes nothing; instead, your application must initialize all fields of the
GDevicerecord. After your application initializes the color table for the
GDevicerecord, your application should call the Color Manager procedure
MakeITableto build the inverse table for the graphics device.
InitGDeviceprocedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.
GDevicerecord 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 the
MakeITableprocedure is described in the chapter "Color Manager" in Advanced Color Imaging on the Mac OS.