Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Starbase Display List Programmer's Manual: HP 9000 Series 700 Computers > Chapter 4 The Basics of Using a Display List

Opening and Closing Segments

» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Opening a Segment

Once a display list is opened, you can create segments in it. A segment is a collection of elements, which are either Starbase primitive calls, attribute calls, or control functions. To open a segment, use the routine open_segment:

open_segment(〈fildes〉, 〈segno〉, 〈append〉, 〈display〉);

where:

  • segno〉 is an integer that is uniquely associated with the segment of interest.

  • append〉 is a boolean that specifies whether the element pointer is to be set to the end of the segment or to be left where it is. If 〈append〉 is FALSE, the element pointer is left where it was when the segment was previously closed (or at the null element if the segment hasn't been opened before); if 〈append〉 is TRUE, the element pointer is set to the last element in the segment.

  • display〉 is a boolean that specifies whether or not the following graphics calls are to be inserted into the display list, displayed, or both. If 〈display〉 is DL_ONLY (or FALSE), the elements are merely inserted into the segment; if 〈display〉 is DL_AND_DISPLAY (or TRUE), any subsequent elements in the segment are inserted into the segment and displayed on the display device; if 〈display〉 is DISPLAY_ONLY, any subsequent elements in the segment are displayed on the display device but are not inserted into the segment.

Some things to be aware of when opening segments are as follows:

  • A segment must be opened prior to adding to, modifying, or inquiring its contents. Adding to a segment's contents is mentioned above: merely open a segment and do some Starbase operations. Modifying (other than just adding to) a segment, as well as inquiring a segment's contents, are discussed later.

  • At any one time, there can only be one open segment per display list. If you open a segment and then open another segment before explicitly closing the first one, Display List closes the first segment before opening the second.

  • When a segment is opened for the first time, an empty segment is created. In other words, there is nothing special you need to do to "create" a segment before you open it. If you open a segment that has not been referenced before, Display List creates a new, empty segment, and then opens it.

Closing a Segment

Closing a Display List segment is trivial:

close_segment(〈fildes〉);

There are no parameters such as 〈append〉 or 〈display〉, because they are irrelevant to the closing operation. There is no need even for a segment number: since only one segment can be open at any one time, there can be no ambiguity as to which segment you are specifying. If there are no segments currently open, close_segment is a no-op.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1995 Hewlett-Packard Development Company, L.P.