I suppose I really need to re-phrase my question to
ask if there's an reasonably OS-agnostic way to do double-buffering in
Double buffering is outside the scope of OpenGL itself. It's down to the
window system, which means that it involves platform-specific functions.
On X11, double-buffering is enabled by specifying the GLX_DOUBLEBUFFER
attribute when using glXChooseVisual() to choose a visual to pass to
On Windows, it's enabled by specifying the PFD_DOUBLEBUFFER flag when
calling ChoosePixelFormat(), setting that format on the DC with
SetPixelFormat(), then creating a GL context for that DC with
The procedure is similar on MacOS X, although there are different
mechanisms for Carbon (C) and Cocoa (Objective-C).
The main reason GLUT was created was to provide a simple, cross-platform
interface to the window system.
You will find similar functionality in any cross-platform GUI toolkit
which includes OpenGL support (e.g. GTK, Qt, wxWidgets), as well as
cross-platform graphics libraries which don't provide more complex GUI
functionality (e.g. GLUT, GLFW, SDL, SFML).
All of those provide cross-platform context management functions by
writing distinct versions of the functions for Windows, X11 and MacOS X.