[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

glXSwapBuffers Subroutine


Makes the back buffer visible.


OpenGL C bindings library: libGL.a

C Syntax

void glXSwapBuffers(Display *dpy
      GLXDrawable Drawable)


The glXSwapBuffers subroutine promotes the contents of the back buffer of Drawable to become the contents of the front buffer of Drawable. The contents of the back buffer then become undefined. The update typically takes place during the vertical retrace of the monitor, rather than immediately after glXSwapBuffers is called. All GLX rendering contexts share the same notion of which are front buffers and which are back buffers.

An implicit glFlush subroutine is performed by the glXSwapBuffers subroutine before it returns. Subsequent OpenGL commands can be issued immediately after calling glXSwapBuffers, but these commands are not executed until the buffer exchange is complete.

If the window specified by the Drawable parameter was not created with respect to a double-buffered visual, the glXSwapBuffers subroutine has no effect and no error is generated.


dpy Specifies the connection to the X server.
Drawable Specifies the window whose buffers are to be swapped.


Synchronization between multiple GLX contexts that render to the same double-buffered window is the responsibility of the client. The X Synchronization Extension can be used to facilitate this cooperation.

Error Codes

GLXBadDrawable Is generated if the Drawable parameter is not a valid GLX drawable.
GLXBadCurrentWindow Is generated if the dpy and Drawable parameters are respectively the display and drawable associated with the current context of the calling thread, and the Drawable parameter identifies a window that is no longer valid.


/usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL.

Related Information

The glFlush subroutine.

OpenGL in the AIXwindows (GLX) Environment.

OpenGL Overview.

[ Previous | Next | Contents | Glossary | Home | Search ]