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 usesGDevice
records to maintain information about video devices and offscreen graphics worlds. AGDevice
record must be allocated with theNewGDevice
function and initialized with theInitGDevice
procedure. Normally, your application does not call these routines directly. When the system starts up, it allocates and initializes one handle to aGDevice
record for each video device it finds. When you use theNewGWorld
function (described in the chapter "Offscreen Graphics Worlds" in this book), Color QuickDraw automatically creates aGDevice
record 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
SetGDevice
procedure 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 switchesGDevice
records as appropriate; and when your application needs to draw into an offscreen graphics world, it can use theSetGWorld
procedure to set the graphics port as well as theGDevice
record for the offscreen environment. However, if your application uses theSetPort
procedure (described in the chapter "Basic QuickDraw" in this book) instead of theSetGWorld
procedure to set the graphics port to or from an offscreen graphics world, then your application must useSetGDevice
in conjunction withSetPort
.You use the
SetDeviceAttribute
procedure to set attribute bits in aGDevice
record.When Color QuickDraw no longer needs a
GDevice
record, it uses theDisposeGDevice
procedure 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