Important: The information in this document is obsolete and should not be used for new development.
InitGDevice
TheNewGDevicefunction uses theInitGDeviceprocedure to initialize aGDevicerecord.
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
NewGDevicefunction, to theGDevicerecord to be initialized.DESCRIPTION
TheInitGDeviceprocedure initializes theGDevicerecord specified in thegdhparameter. TheInitGDeviceprocedure sets the graphics device whose driver has the reference number specified in thegdRefNumparameter to the mode specified in themodeparameter. TheInitGDeviceprocedure then fills out theGDevicerecord, previously created with theNewGDevicefunction, to contain all information describing that mode.The
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, thenInitGDeviceuses 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 usesNewGDeviceto create a graphics device without a driver,InitGDevicedoes nothing; instead, your application must initialize all fields of theGDevicerecord. After your application initializes the color table for theGDevicerecord, your application should call the Color Manager procedureMakeITableto build the inverse table for the graphics device.The
InitGDeviceprocedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.SEE ALSO
TheGDevicerecord 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 themodeparameter. TheMakeITableprocedure is described in the chapter "Color Manager" in Advanced Color Imaging on the Mac OS.