我试图在我的linux机器上支持opengl版本。我有一台linux机器,它有glxinfo输出
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.4, 128 bits)
OpenGL version string: 2.1 Mesa 10.1.3
OpenGL shading language version string: 1.30
我认为这意味着它支持opengl高达2.1。现在,当我检查Opengl 3.1版本glewIsSupported(GL_VERSION_3_1)
和glewIsSupported(GL_VERSION_3_2)
时,它返回true。但它为glewIsSupported(GL_VERSION_3_3)
返回false。 glxewIsSupported(GLX_ARB_create_context)
也返回true。我也检查了
对于在opengl 3.1中添加的某些扩展名,如
glewIsSupported("GL_ARB_copy_buffer") : returns true
glewIsSupported("GL_ARB_draw_instanced") : returns true
对于在opengl 3.2中添加的某些扩展名,如
glewIsSupported("GL_ARB_depth_clamp") : returns true
对于在opengl 3.3中添加的某些扩展名,如
glewIsSupported("GL_ARB_blend_func_extended") : returns false
这意味着这意味着这台机器支持opengl 3.2,但是为什么glxinfo会返回它支持2.1。我也尝试创建oepngl 3.1前向兼容上下文,但它失败并出现以下错误。所以我假设这不支持opengl 3.1。
X Error of failed request: GLXBadFBConfig
Major opcode of failed request: 154 (GLX)
Minor opcode of failed request: 34 ()
Serial number of failed request: 52
Current serial number in output stream: 51
我还有一台机器
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon HD 5450
OpenGL version string: 4.3.12798 Compatibility Profile Context 13.35.1005
OpenGL shading language version string: 4.30
它为所有扩展提供了通行证。我认为这是有道理的。但我仍然不理解第一台机器的行为。
基本上我要做的是重现第一台机器不支持opengl 3.1前向兼容性配置文件而第二台机器使用GLEW
的条件,因为我不知道其他任何方式。有什么帮助吗?
注意:我需要检查前向兼容的配置文件或核心配置文件。我之前问了一个类似的问题,但是这个问题提供了更多信息。很抱歉重复这个问题
ldd - > glxinfo
linux-vdso.so.1 => (0x00007fff3b5cc000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007faa836f2000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007faa833bd000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007faa82fff000)
libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007faa82dd8000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007faa82bc7000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007faa829c4000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007faa827be000)
libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007faa825bc000)
libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007faa823a5000)
libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007faa821a0000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007faa81f82000)
libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007faa81d7d000)
libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007faa81b72000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007faa81955000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007faa81751000)
/lib64/ld-linux-x86-64.so.2 (0x00007faa83956000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007faa8154e000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007faa81348000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007faa81140000)
ldd->我的程序
linux-vdso.so.1 => (0x00007ffef7c7a000)
libmaptype.so => /home/oemtest/mapping/dev/cook_126275//bin/libmaptype.so (0x00007f590b814000)
libpng.so => /home/oemtest/mapping/dev/cook_126275//bin/libpng.so (0x00007f590b5dd000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007f590b379000)
libGLU.so.1 => /usr/lib/x86_64-linux-gnu/libGLU.so.1 (0x00007f590b10b000)
libglut.so.3 => /usr/lib/x86_64-linux-gnu/libglut.so.3 (0x00007f590aec5000)
libGLEW.so.1.5 => /usr/lib/libGLEW.so.1.5 (0x00007f590ac6f000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f590a973000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f590a673000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f590a45d000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f590a09f000)
zlib.so => /home/oemtest/mapping/dev/cook_126275//bin/zlib.so (0x00007f5909e8a000)
libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007f5909c63000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f5909a52000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f590984f000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f5909649000)
libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f5909447000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f5909112000)
libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007f5908efb000)
libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007f5908cf6000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f5908ad8000)
libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f59088d3000)
libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f59086c8000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f59084ab000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f59082a7000)
/lib64/ld-linux-x86-64.so.2 (0x00007f590bb77000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f59080a4000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f5907e9e000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f5907c96000)
我还有一台机器有glxinfo输出
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) G45/G43 x86/MMX/SSE2
OpenGL version string: 2.1 Mesa 9.2.1
OpenGL shading language version string: 1.20
它的行为类似于第一台机器。也是的,第一台机器是VM。但是这台新机器不是VM而是物理机器。这是用于这台新机器http://pastebin.com/hqEPzCPV
的完整glxinfo日志的pastebin glutInit(&argc, argv);
glutInitDisplayMode(/*GLUT_DEPTH |*/ GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowPosition(100,100);
glutInitWindowSize(m_pngWidth, m_pngHeight);
int winID = glutCreateWindow("osm2png");
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (err != GLEW_OK)
{
return OPENGL_VERSION_UNSUPPORTED;
}
//This shows that it supports opengl version 3.1.
if (glewIsSupported("GL_VERSION_3_1"))
openglDriverType = MT_GLSL_3_1;
else
return OPENGL_VERSION_UNSUPPORTED;
#else
return OPENGL_VERSION_UNSUPPORTED;