Opening a Display List |
 |
When a Starbase X11 window is opened in a program using Display
List, a device-dependent display list is opened and associated with
that display device. The display list is device-dependent because
it is associated with a particular device (see below for a discussion
of device-independent display lists).
The file descriptor returned by the gopen call is used to access
both the graphics display device and its associated display list.
A device-dependent display list for an HP graphics window
is created with the following call in C[11]:
fildes = gopen("〈screen〉/starbase_window",
OUTDEV, NULL, INIT); |
To modify this call for other windows or devices, change the
"〈screen〉/starbase_window" |
to the appropriate window name or device file. Or, better
yet, don't hard-code the device-file name into the source code;
use argc and
argv to pass
the desired value to the program, or get the value from environment
variables through getenv.
For further details, review the Starbase Graphics Techniques
provided with your system.
You can also open a device-independent
display list, a display list not associated
with a particular output device. This is done by calling gopen and specifying the
null device 〈dev〉/null", as the device file
and the display list device driver "display_list"
as the graphics device driver[12]:
fildes = gopen("〈dev〉/null", OUTDEV, "display_list", INIT); |
A device-independent display list is useful if one display
list is to be displayed on several devices or in several windows.
Device-dependent optimizations at creation time cannot be made for
a device-independent display list. As a result, performance may
be better using a device-dependent display list. Thus, if you do
not need the device-independence, your choice would probably be
the device-dependent list associated with the graphics device.
Segments can be created, deleted and manipulated in each open
display list independent of all other display lists. A display list
must be open to operate on it.
Closing a Display List |
 |
A device-independent display list is closed in the same way
a device-dependent display list is closed — a simple call
to gclose:
When the graphics display device is closed, the display list
associated with the device is closed and deleted.