Sure. Here is my pbuffer creation code.It should be pretty straightforward.
bool glpbuffer::initialize(Display *dpy,bool ownContext,bool shareContext,GLXContext glxrc) {
int attrib[] = {
GLX_DOUBLEBUFFER, (doublebuffer) ? 1:0,
GLX_RED_SIZE, colorbits[0],
GLX_GREEN_SIZE, colorbits[1],
GLX_BLUE_SIZE, colorbits[2],
GLX_ALPHA_SIZE, colorbits[3],
GLX_DEPTH_SIZE, depthbits,
GLX_STENCIL_SIZE,stencilbits,
GLX_RENDER_TYPE, (floatcomponents) ? GLX_RGBA_FLOAT_ATI_BIT:GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
None
};
int pbufAttrib[] = {
GLX_PBUFFER_WIDTH, width,
GLX_PBUFFER_HEIGHT, height,
GLX_LARGEST_PBUFFER, False,
None
};
int nitems=9;
// check connection to x server
if(dpy == NULL) return false;
this->dpy = dpy;
// find pixel format
int scrnum = DefaultScreen( dpy );
fbconfig = glXChooseFBConfig(dpy,scrnum,attrib,&nitems);
if (fbconfig == NULL) {
return false;
}
// create pbuffer
pbuf = glXCreatePbuffer(dpy, fbconfig[0], pbufAttrib);
visinfo = glXGetVisualFromFBConfig(dpy, fbconfig[0]);
if (visinfo == NULL) {
XFree(fbconfig);
glXDestroyPbuffer(dpy,pbuf);
}
if(ownContext) {
if(shareContext)
pbuf_ctx = glXCreateNewContext(dpy,fbconfig[0],GLX_RGBA_TYPE,glxrc,GL_TRUE);
else
pbuf_ctx = glXCreateNewContext(dpy,fbconfig[0],GLX_RGBA_TYPE,NULL,GL_TRUE);
if(pbuf_ctx == NULL) {
XFree(fbconfig);
glXDestroyPbuffer(dpy,pbuf);
XFree(visinfo);
return false;
}
}
else {
pbuf_ctx = glxrc;
shared_ctx = true;
}
pbuf_created = true;
return true;
}