[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
GL3.2 for AIX: Graphics Library (GL) Technical Reference

swapbuffers Subroutine

Purpose

Exchanges the front and back buffers in double buffer mode.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void swapbuffers( )

FORTRAN Syntax

SUBROUTINE SWAPBU

Description

The swapbuffers subroutine exchanges the front and back buffers in double buffer mode. Once an image is fully drawn in the back buffer, the swapbuffers subroutine displays that image.

The swapping of buffers occurs only during a vertical retrace. A minimum of the number of vertical retraces specified by the swapinterval subroutine must have elapsed since the last call to swapbuffers before the current request is honored. After this call is made, all drawing to the front and back buffers is disabled until the swap occurs.

This subroutine is ignored in single buffer mode.

Example

The example C language program backface.c uses the swapbuffers subroutine to display a cube after drawing it in the back buffer.

Implementation Specifics

This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.

Files

/usr/include/gl/gl.h Contains C language constant and variable type definitions for GL.
/usr/include/gl/fgl.h Contains FORTRAN constant and variable type definitions for GL.

Related Information

Enabling drawing in the back buffer with the backbuffer subroutine.

Setting the display mode to double buffer mode with the doublebuffer subroutine.

Enabling drawing in the front buffer with the frontbuffer subroutine.

Defining a minimum time between buffer swaps with the swapinterval subroutine.

Understanding the Hardware Used by GL in GL3.2 Version 4 for AIX: Programming Concepts.

Configuring the Frame Buffer and Creating Animated Scenes.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]