GLXCREATEPBUFFER(3GL)GLXCREATEPBUFFER(3GL)NAME
glXCreatePbuffer - create a Pbuffer
C SPECIFICATION
GLXPbuffer glXCreatePbuffer ( Display *dpy,
GLXFBConfig config,
int *attrib_list)
PARAMETERS
dpy Specifies the connection to the X server.
config Specifies the GLX configuration that defines the capa‐
blilty of the Pbuffer.
attrib_list Specifies a list of attributes for the pbuffer.
DESCRIPTION
glXCreatePbuffer creates a non-visible rendering pixel buffer GLXP‐
buffer, (or pbuffer for short) for an OpenGL renderer, and returns its
XID. GLXPbuffers are equivalent to GLXPixmaps with the following excep‐
tions:
1. There is no associated X pixmap. Also, since a GLXPbuffer is a
GLX resource, it may not be possible to render to it using X or
an X extension other than GLX.
2. The format of the color buffers and the type and size of any
associated ancillary buffers for a GLXPbuffer can only be
described with a GLXFBConfig which an X Visual cannot be used.
3. GLXPbuffer can be rendered to using either direct or indirect
rendering contexts.
Any GLX rendering context created with a GLXFBConfig or X Visual that
is "compatible" with the <config> may be used to render into the
pbuffer. (See glXCreateNewContext, and glXMakeContextCurrent for defi‐
nition of "compatible".)
In some implementations, a GLXPbuffer is allocated on off-screen frame
buffer memory. In this case, the contents of a GLXPbuffer may be asyn‐
chronously lost at any time.
attrib_list has the same structure as described for glXChooseFBConfig.
Currently only four attributes can be specified in
attrib_list:GLX_PBUFFER_WIDTH, GLX_PBUFFER_HEIGHT, GLX_PRESERVED_CON‐
TENS and GLX_LARGEST_PBUFFER. attrib_list may be NULL or empty (first
attribute of None), in which case all the attributes assumes their
default value described below.
GLX_PBUFFER_WIDTH and GLX_PBUFFER_HEIGHT specify the pixel width and
height of the rectangular pbuffer. The default values for
GLX_PBUFFER_WIDTH and GLX_PBUFFER_HEIGHT are zero
Use GLX_LARGEST_PBUFFER to get the largest available pbuffer when the
allocation of the rectangular pbuffer would otherwise fail. The width
and height of the allocated pbuffer will never exceed the values of
GLX_PBUFFER_WIDTH and GLX_PBUFFER_HEIGHT, respectively. By deafult,
GLX_LARGEST_PBUFFER is False.
if the GLX_PRESERVED_CONTENS attribute is set to False in attrib_list,
then an unpreserved pbuffer is created and the contents of the pbuffer
may be lost at any time. If the attribute is not specified, or True in
attrib_list, then when a resource conflict occurs the contents of the
pbuffer will be preserved. In either case, the client can register to
receive a pbuffer clobber event which is generated when the pbuffer
contents have been preserved or have been damaged (See glXSelectEvent
for more information).
NOTES
1. The pbuffer contains color buffers and ancillary as specified by
config. In Sun's implementation, Pbuffer is allocated in the
main memory, and GLX_LARGEST_PBUFFER_SGIX is always False and
GLX_PRESERVED_CONTENTS_SGIX True. That is, pbuffer content is
always preserved.
2. glXCreatePbuffer is part of the GLX Version 1.3 command set. The
function is only valid if the connection supports GLX Version1.3
or later.
ERRORS
BadAlloc is generated and None is returned if glXCreatePbuffer fails to
create a GLXPbuffer due to insufficient resources.
GLXBadFBConfig is generated if config is not a valid GLXFBConfig.
BadMatch is generated if config does not support GLXPbuffers.
SEE ALSO
glXChooseFBConfig, glXCreateNewContext, glXDestroyPbuffer, glXMakeCur‐
rent, glXMakeContextCurrent, glXSelectEvent, glXQueryContext.
20 May 01 GLXCREATEPBUFFER(3GL)