Element: graphic_window.double_buffering

Type

numeric

Description

Whether graphic drawing in graphic_window is to be double buffered.

This element has a value of 1 when double buffering is enabled, and 0 when double buffering is not enabled.

Without double buffering the window is cleared before its contents, i.e. entity graphics, get redrawn. This can be irritating to some users as the window tends to "flash" while the window is cleared, but it has the advantage that the rendering of individual entity graphics can be seen during the redraw process.

Double buffering the output computes the new image off-screen before displaying it when complete. This gives the effect of a smooth transition but is not always desirable as some complex graphics require time-consuming repaints, therefore a longer delay between completed images.

When double buffering is enabled it uses window "save under" facilities. Therefore window.save_under is set unless it was already set.

Turning this value on will perform an immediate repaint of the window.

On Windows systems, when many large graphic windows are in use, all with double buffering, the system sometimes runs out of global memory due to the persistent offscreen memory requirements used by window "save unders". Currently there is no way around this problem even though the system appears to have ample memory available, beacause there is an imposed limit for bitmap storage unrelated to total system memory. In such cases, double buffering can be enabled without using the window save under by setting double buffering to -1 instead of 1, e.g.

mywin.save_under = 0
mywin.double_buffering = -1

See Also

Commands:

wpaint

Structures:

window.save_under