Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 6 - Offscreen Graphics Worlds / Offscreen Graphics Worlds Reference
Routines / Saving and Restoring Graphics Ports and Offscreen Graphics Worlds


GetGWorld

To save the current graphics port (basic, color, or offscreen) and the current GDevice record, use the GetGWorld 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
The GetGWorld procedure returns a pointer to the current graphics port in the port parameter. This parameter can return values of type GrafPtr, CGrafPtr, or GWorldPtr, depending on whether the current graphics port is a basic graphics port, color graphics port, or offscreen graphics world. The GetGWorld procedure returns a handle to the GDevice record for the current device in the gdh parameter.

After using GetGWorld to save a graphics port and a GDevice record, your application can later use the SetGWorld procedure, described next, to restore them.

SPECIAL CONSIDERATIONS
The GetGWorld 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 the GetGWorld procedure are
Trap macroSelector
_QDExtensions$00080005

SEE ALSO
Listing 6-1 on page 6-5 and Listing 6-2 on page 6-10 illustrate how to use the GetGWorld procedure to save the current graphics port for an active window, the SetGWorld procedure to change the current graphics port to an offscreen graphics world, and then SetGWorld again to restore the active window as the current graphics port.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996