[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
OpenGL 1.2 for AIX: Reference Manual

glXSwapBuffers Subroutine

Purpose

Makes the back buffer visible.

Library

OpenGL C bindings library: libGL.a

C Syntax

void glXSwapBuffers(Display *dpy
                    GLXDrawable Drawable)

Description

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 Drawable was not created with respect to a double-buffered visual or GLX FBConfig, or if Drawable is a GLX pixmap, the glXSwapBuffers subroutine has no effect and no error is generated.

Parameters

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

Notes

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

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

Files

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

Related Information

The glFlush subroutine.

OpenGL in the AIXwindows (GLX) Environment.

OpenGL Overview.


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