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 currentGDevice
record, use theGetGWorld
procedure.
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
GDevice
record for the current device.DESCRIPTION
TheGetGWorld
procedure returns a pointer to the current graphics port in theport
parameter. 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. TheGetGWorld
procedure returns a handle to theGDevice
record for the current device in thegdh
parameter.After using
GetGWorld
to save a graphics port and aGDevice
record, your application can later use theSetGWorld
procedure, described next, to restore them.SPECIAL CONSIDERATIONS
TheGetGWorld
procedure 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 theGetGWorld
procedure 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 theGetGWorld
procedure to save the current graphics port for an active window, theSetGWorld
procedure to change the current graphics port to an offscreen graphics world, and thenSetGWorld
again to restore the active window as the current graphics port.