Important: The information in this document is obsolete and should not be used for new development.
Creating, Setting, and Disposing of GDevice Records
Color QuickDraw usesGDevicerecords to maintain information about video devices and offscreen graphics worlds. AGDevicerecord must be allocated with theNewGDevicefunction and initialized with theInitGDeviceprocedure. Normally, your application does not call these routines directly. When the system starts up, it allocates and initializes one handle to aGDevicerecord for each video device it finds. When you use theNewGWorldfunction (described in the chapter "Offscreen Graphics Worlds" in this book), Color QuickDraw automatically creates aGDevicerecord for the new offscreen graphics world.Whenever QuickDraw routines are used to draw into a graphics port on a video device, Color QuickDraw uses the
SetGDeviceprocedure to make the video device for that screen the current device. Your application won't generally need to use this procedure, because when your application draws into a window on one or more screens, Color QuickDraw automatically switchesGDevicerecords as appropriate; and when your application needs to draw into an offscreen graphics world, it can use theSetGWorldprocedure to set the graphics port as well as theGDevicerecord for the offscreen environment. However, if your application uses theSetPortprocedure (described in the chapter "Basic QuickDraw" in this book) instead of theSetGWorldprocedure to set the graphics port to or from an offscreen graphics world, then your application must useSetGDevicein conjunction withSetPort.You use the
SetDeviceAttributeprocedure to set attribute bits in aGDevicerecord.When Color QuickDraw no longer needs a
GDevicerecord, it uses theDisposeGDeviceprocedure to dispose of it. As with the other routines described in this section, your application typically does not need to useDisposeGDevice.
Subtopics
- NewGDevice
- InitGDevice
- SetDeviceAttribute
- SetGDevice
- DisposeGDevice