Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

DOUBLE_BUFFER(3G)

NAME

double_buffer − enable/disable double buffering

SYNOPSIS

C Syntax:

int double_buffer(fildes,mode,planes);
int fildes, mode,planes;

FORTRAN77 Syntax:

integer*4 function double_buffer(fildes,mode,planes)
integer*4 fildes, mode, planes

Pascal Syntax:

function double_buffer(fildes,mode,planes:integer):integer;

DESCRIPTION

Input Parameters

fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened. 

mode Specifies whether double buffering is on or off and whether to update the color map and whether to draw to the same buffer that displayed. 

planes Specifies the number of planes in each buffer for input.  Allowable requests are 1, 2, 3, 4, 6, 8 and 12. 

Discussion

double_buffer is used to enable/disable double buffering and define buffering parameters.  In addition to the device file descriptor, this function accepts two parameters: mode and planes. 

• If the least significant bit of mode is set to TRUE (1), double buffering is enabled and the display and write enable registers are set up according to the hardware configuration and planes parameter.  If INIT is ORed with mode, the color map is set up properly and color indices are correctly interpreted.  If DFRONT is ORed with mode, then the buffer that is enabled for display will also be enabled for writing.  This makes switching in and out of double buffering mode much simpler. 

• The planes parameter specifies the number of planes to be used for each buffer.  Legal values for this parameter are 1, 2, 3, 4, 6, 8, or 12.  The number of planes actually being used for double buffering is returned by this function.  Obviously an application must not request more than half the number of planes installed on the graphics device being used.  If this occurs, Starbase sets the number of planes used to the maximum legal value.  Conversely, if an application requests fewer than the maximum number of planes, the uppermost planes are used.  Unused planes are write disabled and display enabled.  Note that if fewer than 3 planes are requested for each buffer, the color map mode should be set to CMAP_NORMAL or CMAP_MONOTONIC (see SHADE_MODE). 

After double buffering has been set up with double_buffer, the buffers can be switched using dbuffer_switch.

If only one plane is available on the device or the color map mode is CMAP_FULL and there are fewer than 6 planes available on the device, double buffering cannot be enabled and an error is generated, if requested.  Subsequent calls to dbuffer_switch result in only a clear_view_surface.

When double buffering is disabled, Starbase returns the display and write enable registers to their current values and/or resets the bank_select to its current value. 

If 6 planes are requested when 8 are available, all 8 will actually be used. 

RETURN VALUE

Upon completion of this function, a non-negative number is returned that is the actual number of planes being used for double buffering.  This number is the number requested unless the device cannot support that many planes. 

DEFAULTS

mode = 0:double buffering off.

SEE ALSO

dbuffer_switch (3G), Starbase Programming Techniques.

Hewlett-Packard Company  —  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026