
Data Transfer
Quadro SDI Output PG-03776-001_v06 | 21
if (glXGetFBConfigAttrib(dpy, configs[i],
GLX_ALPHA_SIZE, &attr)) {
// Handle error
}
if (attr != 16)
continue;
break;
}
if (i == nelements) {
printf("No 16-bit FBConfigs found\n");
return -1;
}
// Config found
config = configs[i];
// Don't need the config list anymore so free it.
XFree(configs);
configs = NULL;
pbuffer_list[0] = GLX_PBUFFER_WIDTH;
pbuffer_list[1] = gWidth;
pbuffer_list[2] = GLX_PBUFFER_HEIGHT;
pbuffer_list[3] = gHeight;
pbuffer_list[4] = None;
// Create pbuffer
pbuffer = glXCreatePbuffer(dpy, config, pbuffer_list);
// Create rendering context for GLX_RGBA_FLOAT_TYPE_ARB pbuffer.
context = glXCreateNewContext(dpy, config,
GLX_RGBA_FLOAT_TYPE_ARB, 0, True);
Note: Checking the proper color depth of the chosen FBConfig is required as
glXChooseFBConfig in recent Linux drivers returns deeper FBConfigs at the
beginning of the resulting list. As a result 32-bit FBConfigs appear earlier in the list
than FP16 or 8-bit integer configs. The change was made to bring the behavior of
glXChooseFBConfig inline with the specification.
Comentários a estes Manuais