c++ - 虚拟机中的OpenGL问题

标签 c++ opengl virtual-machine vmware virtualbox

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/

相关文章:

c++ - freeglut 如何探测 X11 服务器是否可用?

rest - 是否有机会使用 rest API 在 ManageIQ 中创建 VM?

c++ - 为什么非 const、非 int/enum 静态数据成员必须在定义之外初始化?

c++ - SFML 和 GTK+ - GtkFileChooserDialog

c++ - 在 C++ 中使用带有正则表达式的 g++ 和 Visual Studio 14 2015 编译器时的不同结果

c - OpenGL usampler2d值不能被除

c++ - GLTest.exe 中的 opengl 错误 : Unhandled exception at 0x0251D09F (ig4dev32. dll:0xC0000005:访问冲突读取位置 0x00000000

azure - 实例关闭后 Azure 虚拟机存储是否会丢失?

linux - 我可以将 Linux 虚拟 LAMP 设置复制到真实服务器吗?

c++ - 如何在C++中获得二维数组中一列的最低数目?