Important: The information in this document is obsolete and should not be used for new development.
GetGWorld
To save the current graphics port (basic, color, or offscreen) and the currentGDevicerecord, use theGetGWorldprocedure.
PROCEDURE GetGWorld (VAR port: CGrafPtr; VAR gdh: GDHandle);
port- A pointer to an offscreen graphics world, color graphics port, or basic graphics port, depending on which is the current port.
gdh- A handle to the
GDevicerecord for the current device.DESCRIPTION
TheGetGWorldprocedure returns a pointer to the current graphics port in theportparameter. This parameter can return values of typeGrafPtr,CGrafPtr, orGWorldPtr, depending on whether the current graphics port is a basic graphics port, color graphics port, or offscreen graphics world. TheGetGWorldprocedure returns a handle to theGDevicerecord for the current device in thegdhparameter.After using
GetGWorldto save a graphics port and aGDevicerecord, your application can later use theSetGWorldprocedure, described next, to restore them.SPECIAL CONSIDERATIONS
TheGetGWorldprocedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theGetGWorldprocedure are
Trap macro Selector _QDExtensions $00080005 SEE ALSO
Listing 6-1 on page 6-5 and Listing 6-2 on page 6-10 illustrate how to use theGetGWorldprocedure to save the current graphics port for an active window, theSetGWorldprocedure to change the current graphics port to an offscreen graphics world, and thenSetGWorldagain to restore the active window as the current graphics port.