GpiErase clears the output display of the currently associated device to CLR_BACKGROUND, which is the normal background color for the device. If you are using the default color table, this value clears the window background to white. This is a once-only request and must be issued each time you want the display screen cleared before drawing a new picture. You can use this function for either a micro presentation space or a normal presentation space.
To get this effect for more than one drawing request, you can use GpiSetDrawControl. This function establishes current values for five drawing controls, which remain in effect until they are reset. The following table describes the five drawing controls.
Drawing Controls
┌────────────────────────┬────────────────┬────────────────────┐ │Control │Value │If set, the │ │ │ │operating system... │ ├────────────────────────┼────────────────┼────────────────────┤ │Boundary data │DCTL_BOUNDARY │computes the │ │accumulation │ │dimensions of the │ │ │ │smallest rectangle │ │ │ │that would │ │ │ │completely surround │ │ │ │the retained-drawing│ │ │ │output. │ │ │ │This control is │ │ │ │described in │ │ │ │Clipping and │ │ │ │Boundary │ │ │ │Determination. │ ├────────────────────────┼────────────────┼────────────────────┤ │Correlation │DCTL_CORRELATE │performs correlation│ │ │ │operations on any │ │ │ │primitives or any │ │ │ │output associated │ │ │ │with GpiPutData or │ │ │ │GpiElement. │ │ │ │This control is │ │ │ │described in │ │ │ │Correlation. │ ├────────────────────────┼────────────────┼────────────────────┤ │Display control │DCTL_DISPLAY │draws retained │ │ │ │output on the device│ │ │ │identified by the │ │ │ │current device │ │ │ │context. If this │ │ │ │control is not set, │ │ │ │no retained output │ │ │ │will appear on the │ │ │ │device. │ ├────────────────────────┼────────────────┼────────────────────┤ │Draw-dynamic-segments │DCTL_DYNAMIC │calls │ │ │ │GpiRemoveDynamics │ │ │ │before drawing any │ │ │ │retained output and │ │ │ │then, after drawing │ │ │ │the retained output,│ │ │ │it calls │ │ │ │GpiDrawDynamics to │ │ │ │draw output stored │ │ │ │in dynamic segments.│ │ │ │This automatically │ │ │ │removes all dynamic │ │ │ │segments from the │ │ │ │display screen │ │ │ │before a GpiDraw... │ │ │ │request is issued, │ │ │ │then later redraws │ │ │ │the segments. This │ │ │ │ensures that dynamic│ │ │ │segments are always │ │ │ │drawn on top of │ │ │ │nondynamic segments │ │ │ │and primitives. │ ├────────────────────────┼────────────────┼────────────────────┤ │Erase-before-draw │DCTL_ERASE │calls GpiErase │ │ │ │before drawing any │ │ │ │retained output. │ └────────────────────────┴────────────────┴────────────────────┘
GpiSetDrawControl can be called in either a micro or a normal presentation space, although not all of the controls are valid in a micro presentation space. GpiDrawSegment can be used to draw a dynamic segment in some circumstances. Its effects are as follows:
If you called GpiRemoveDynamics prior to calling GpiDrawDynamics and you specified a range of dynamic segments, the operating system draws only that range. If you set the DCTL_DYNAMIC control using GpiSetDrawControl, the operating system calls GpiRemoveDynamics before drawing the subpictures from the dynamic segments.
The DCTL_DISPLAY control is the only control set to DCTL_ON by default. All other controls are set to DCTL_OFF when you create a presentation space.