GL.mesa - Procs to allow user to start, end and execute lists.
last changed by Mik Lamming, January 4, 1983 11:11 am
Last Edited by: Stone, March 18, 1983 2:15 pm
DIRECTORY
Graphics   USING [Context];
GL: CEDAR DEFINITIONS = {
Types
List: TYPE = REF ListRec;
ListRec: TYPE;
Graphics lists are constructed by applying regular CedarGraphics functions in a special context obtained from this package via the GL.Start function. The list is terminated by the GL.End function which returns the list to the client. The list can be executed to produce the image using the GL.Draw function. GL.Draw will produce the image in any context, e.g. B/W or color display, Press or InterPress. Note that GL.Draw uses the context it is given and will therefor respond to changes in the current transformation or other variables present in the context.
Each graphics list has its own monitor lock to ensure that simultaneous attempts to access or update are queued.
Caveats:
In general functions that return results rather than modifying the context, for example GetCP, do not contribute to the graphics list. Such functions may be used while the list is being computed and will return results consistent with a screen context. The two exceptions to this rule - functions which return results AND modify the context but which nevertheless contribute to the list are Save and Restore. Special care should be exercised when using Restore since only ONE level of save can be restored during execution of a graphics list. This is seen as a deficiency which will be fixed in due course if the need arises!
The function DrawBits is not handled!
It is not yet possible to reference one list from another though Draw may be invoked during a Start/End sequence to copy one list into another.
Client Interface Procedures
Start: PUBLIC PROC[oldList: GL.List ← NIL] RETURNS[dc: Graphics.Context];
Create a graphics list context using oldlist. If oldlist is NIL then a new list is created.
End: PUBLIC PROC[dc: Graphics.Context] RETURNS [list: GL.List];
End returns the current GraphicsList.
If there is no list (list=NIL or dc is wrong type), just returns NIL.
Draw: PROC[context: Graphics.Context, list: GL.List];
Display a graphics list in the given context
}.