Caution: This extension is an SGIX (experimental) extension. The interface or other aspects of the extension may change. A GLXPbuffer is an additional non-visible rendering buffer for an OpenGL renderer. A pbuffer is equivalent to a GLXPixmap with the following exceptions:
Pbuffers can be either "volatile," that is, their contents can be destroyed by another window or pbuffer, or "preserved," that is, their contents are guaranteed to be correct and are swapped out to virtual memory when other windows need to share the same framebuffer space. The contents of a preserved pbuffer are swapped back in when the pbuffer is needed. The swapping operation incurs a performance penalty, so preserved pbuffers should be used only if re-rendering the contents is not feasible.
A pbuffer is intended to be a "static" resource: a program typically allocates it only once, rather than as a part of its rendering loop. The framebuffer resources that are associated with a GLXPbuffer are also static. They are deallocated only when the GLXPbuffer is destroyed, or, in the case of volatile pbuffers, as the result of X server activity that changes framebuffer requirements of the server.
To create a GLXPbuffer, call glXCreateGLXPbufferSGIX():
GLXPbuffer glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfig config, unsigned int *width, unsigned int *height, int attrib_list)This creates a single GLXPbuffer and returns its XID.
Currently only two attributes can be specified in attrib_list: GLX_CONTENTS_PRESERVED_SGIX and GLX_GET_LARGEST_PBUFFER_SGIX.
If glXCreateGLXPbufferSGIX() fails to create a GLXPbuffer due to insufficient resources, a BadAlloc X protocol error is generated and NULL is returned. If config is not a valid GLXFBConfig then a GLXBadFBConfigSGIX error is generated; if config does not support pbuffers, a BadMatch X protocol error is generated.