GREG and the GTVIRT are intimately related, and it is not recommended to use the GTVIRT without GREGAccordingly, the programming example given below also uses some (primitive) GREG subroutines. The basic drawing sequence is
CALL GR_SEGM (Segment_Name,Error) ! 1 CALL GTPOLYL (N,Xarray,Yarray) ! 2 CALL ... ! 3 CALL GTVIEW('Append') ! 4
Further buffering between graphic segments can be obtained by enclosing a set of complete sequences like the above one between a call to GTVIEW('Sleep') and GTVIEW('Wake_up'). Drawing to the screen will then only happen when the call to GTVIEW('Wake_up') is made. For compatibility with other subroutines which may also perform their own Sleep / Wake_up control, it is recommended to use the logical function GTSTAT instead, e.g.
SLEEP = GTSTAT ('Sleep') ... calls to GTVIRT ... IF (.NOT.SLEEP) CALL GTVIEW('Wake_up')