Virtualbox 和 VMware 给我学习 OpenGL 带来了困难。我有一个 Linux 虚拟机 (Lubuntu 12.10),这是我在运行程序时遇到的错误:
VMware:
Unable to create OpenGL context
虚拟盒子:
OpenGL Warning: glFlushVertexArrayRangeNV not found in mesa table
OpenGL Warning: glVertexArrayRangeNV not found in mesa table
OpenGL Warning: glCombinerInputNV not found in mesa table
OpenGL Warning: glCombinerOutputNV not found in mesa table
OpenGL Warning: glCombinerParameterfNV not found in mesa table
OpenGL Warning: glCombinerParameterfvNV not found in mesa table
OpenGL Warning: glCombinerParameteriNV not found in mesa table
OpenGL Warning: glCombinerParameterivNV not found in mesa table
OpenGL Warning: glFinalCombinerInputNV not found in mesa table
OpenGL Warning: glGetCombinerInputParameterfvNV not found in mesa table
OpenGL Warning: glGetCombinerInputParameterivNV not found in mesa table
OpenGL Warning: glGetCombinerOutputParameterfvNV not found in mesa table
OpenGL Warning: glGetCombinerOutputParameterivNV not found in mesa table
OpenGL Warning: glGetFinalCombinerInputParameterfvNV not found in mesa table
OpenGL Warning: glGetFinalCombinerInputParameterivNV not found in mesa table
OpenGL Warning: glDeleteFencesNV not found in mesa table
OpenGL Warning: glFinishFenceNV not found in mesa table
OpenGL Warning: glGenFencesNV not found in mesa table
OpenGL Warning: glGetFenceivNV not found in mesa table
OpenGL Warning: glIsFenceNV not found in mesa table
OpenGL Warning: glSetFenceNV not found in mesa table
OpenGL Warning: glTestFenceNV not found in mesa table
两个 VM 都安装了相应的 guest 附加组件,并启用了 3D 加速。 glxgears 在两台机器上都能工作:/
我的代码与此处相同:http://open.gl/context
我猜问题可能是给定示例中的 OpenGL 版本是 3.2,所以我尝试将其更改为 2.1,此时 VMware 不再给出任何错误,但窗口仍然不显示。
谢谢!
最佳答案
如果您是菜鸟,那么我认为从运行在任何类型的 VM 上的 MESA 开始不是一个好主意。MESA 设置通常非常复杂。而且 MESA OpenGL 已经过时。它最多支持 3.2 版本的 atm .如果你想以正确和干净的方式开始使用 OpenGL,你应该更好地使用 GLUT 或 GLFW 等库设置上下文。并使用 GLEW 加载 GL 扩展(还有更多)。
此外,网上有很多关于如何开始使用 OpenGL 的教程。最好的教程之一可能是 this。 .
并且不要使用 VM,它会大大降低性能。
更新:
正如 Datenwolf 在这里正确指出的那样,MESA 实现并不是“过时的”,而是落后于目前为 4.4 的最新 OpenGL 规范
关于c++ - 虚拟机中的OpenGL问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17966153/