我正在尝试在没有专用显卡的计算机上配置帧缓冲区。只有台面GL。
我尝试了多种 FB 配置,但似乎无法获得非 NULL 返回。相同的代码适用于另一台具有 nvidia 驱动程序的计算机。
OpenGL vendor string: Tungsten Graphics Inc
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Desktop
OpenGL version string: 3.0 Mesa 8.0.4
OpenGL shading language version string: 1.30
在另一台计算机上工作的台面示例也在同一 glXFBConfig 行中失败。
这是代码的相关部分
int fbAttribs[] = {
None
};
int numberOfFramebufferConfigurations = 0;
GLXFBConfig* fbConfigs = glXChooseFBConfig(self->display, DefaultScreen(self->display), fbAttribs, &numberOfFramebufferConfigurations);
正如我所说,我尝试了不同的配置,例如:
int fbAttribs[NUM_FB_CONFIGS][100] = {
{
/* Single buffered, with depth buffer */
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DEPTH_SIZE, 1,
GLX_DOUBLEBUFFER, 0,
GLX_STENCIL_SIZE, 0,
None
},
{
/* Double buffered, with depth buffer */
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DEPTH_SIZE, 1,
GLX_DOUBLEBUFFER, 1,
GLX_STENCIL_SIZE, 0,
None
},
{
/* Single buffered, without depth buffer */
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DEPTH_SIZE, 0,
GLX_DOUBLEBUFFER, 0,
GLX_STENCIL_SIZE, 0,
None
},
{
/* Double buffered, without depth buffer */
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DEPTH_SIZE, 0,
GLX_DOUBLEBUFFER, 1,
GLX_STENCIL_SIZE, 0,
None
}
};
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DEPTH_SIZE, 0,
GLX_DOUBLEBUFFER, 1,
GLX_STENCIL_SIZE, 0,
None
}
};