如何使用 GeForce 9400 在 OS X 上进行 OpenGL 3 编程
我有一台配备 GeForce 9400 显卡的 MacBook Pro。维基百科说该卡支持 OpenGL 3。
但是 OS X 10.6 附带的标头和库似乎仅支持 OpenGL 2(我检查了 /usr/X11/include/
中的文件)。
我需要做一些 OpenGL 3 编程。我可以使用当前的硬件和操作系统来完成此操作吗?我需要获取和安装什么?
I have a MacBook Pro with a GeForce 9400 graphics card. Wikipedia said this card supports OpenGL 3.
But the header and library shipped with OS X 10.6 seems to be OpenGL 2 only (I checked the files in /usr/X11/include/
).
I need to do some OpenGL 3 programming. Can I do it with my current hardware and OS? What do I need to get and install?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
遗憾的是,我认为您还不能,详见此处。
我相信 Lion 会将适用于 OS X 的 OpenGL 升级到 3.2(不幸的是,它仍然缺少更有用的 3.3)。
注意:我没有 Mac,这纯粹是因为尝试在 Windows 端学习现代 OpenGL 并深入了解它的便携性。
编辑:官方 OpenGL 论坛上的此帖子有更多细节。尽管(请参阅此答案下面的评论)可能并不完全清楚为什么供应商无法提供符合 OpenGL 3+ 标准的驱动程序,但似乎很清楚没有办法在 OS X 中使用完全符合 OpenGL 3.3 标准的代码和着色器。提供了一些解决方法然而,在该线程以及我的第一个链接中。
Sadly, I don't think you can yet, as detailed here.
I believe Lion will upgrade OpenGL to 3.2 for OS X though (which is still short of the more useful 3.3 unfortunately).
NB: I do not own a Mac, this is purely from trying to learn modern OpenGL on the windows side and digging around to understand how portable it would be.
Edit: this thread on the official OpenGL forums has more detail. Although (see comments below this answer) it may not be completely clear why vendors cannot provide OpenGL 3+ compliant drivers, it seems pretty clear that there is no way to use fully OpenGL 3.3 compliant code and shaders in OS X. Some workarounds are provided in that thread however, as well as in my first link.
检查各种 OSX 和 Mac 组合上的 OpenGL 支持的最佳位置是:
http://developer.apple.com/graphicsimaging/opengl/capability/
请参阅10.7+ OpenGL 3.2 和 10.7.2 上的 GLSL 1.5 的“核心”子页面
还不错。
The best place to check OpenGL support on the various OSX and Mac combinations is:
http://developer.apple.com/graphicsimaging/opengl/capabilities/
See the "Core" subpage for 10.7+
OpenGL 3.2 with GLSL 1.5 on 10.7.2 isn't too bad.
您当前的硬件可以支持 OpenGL 3,但不支持操作系统。 Mac OS X 10.7 (Lion) 应该支持 OpenGL 3,只有在您可以等待数月的情况下,这才是一个解决方案。
您现在唯一的选择是切换到不同的操作系统,例如 Windows 或 Linux。您必须从另一个操作系统启动,因为虚拟机系统向来宾操作系统提供虚拟视频卡,但没有一个系统具有 OpenGL 3 兼容的虚拟视频卡。
Your current hardware can support OpenGL 3, but not the OS. Mac OS X 10.7 (Lion) should support OpenGL 3, which is a solution only if you can wait many months.
Your only option right now is to switch to a different OS such as Windows or Linux. You'll have to boot from this other operating system, because the virtual machine systems present a virtual video card to the guest operating systems, and none have OpenGL 3 compatible virtual video cards.
(免责声明:此信息基于 Windows OpenGL 并用 glX 替换 wgl。但我确实验证了 GLX 领域中存在相应的扩展)
您不会在任何头文件中找到 OpenGL 3 支持。相反,您需要 GLX_ARB_create_context 扩展。
关于 OSX 中缺少支持的其他答案可能是正确的,但即使支持到来,您也必须使用
glXGetProcAddress
并加载扩展。 (显卡制造商不能通过他们的驱动程序添加对这些扩展的支持吗?为什么需要“操作系统支持”?)(Disclaimer: This information is based on taking Windows OpenGL and replacing wgl with glX. But I did verify that the corresponding extensions exist in GLX land)
You won't find OpenGL 3 support in any header files. Rather you need the GLX_ARB_create_context extension.
The other answers are probably correct about missing support in OSX, but even when support comes, you'll have to use
glXGetProcAddress
and load the extension. (Can't video card manufacturers add support for these extensions through their driver? Why does it require "OS support"?)Windows OpenGL 开发人员在这里。在 Windows 7 上,仅官方支持 OpenGL 1.4,但每个人都通过查询运行时可用的函数来绕过此限制。
在 OSX 上我希望你也能做同样的事情。最简单的方法是使用 OpenGL Extension Wrangler Library:http://www.opengl。 org/sdk/libs/GLEW/
Windows OpenGL developer here. On Windows 7 only OpenGL 1.4 is officially supported, but everyone gets around this limitation by querying which functions are available at run-time.
On OSX I expect you can do the same thing. The easiest way to do this is with The OpenGL Extension Wrangler Library: http://www.opengl.org/sdk/libs/GLEW/