OSX上使用FreeGLUT的OpenGL 3.3

时间:2014-02-03 11:50:43

标签: macos opengl freeglut

我使用以下配置

  • Mac OSX v 10.9.1
  • Intel HD graphics 4000 1024 MB。

我的目标是使用FreeGLUT使用OpenGL 3.3,有没有办法实现这个目标?

glxinfo gives me:
OpenGL vendor string: Intel Inc.
OpenGL renderer string: Intel HD Graphics 4000 OpenGL Engine
OpenGL version string: 2.1 INTEL-8.18.29
OpenGL shading language version string: 1.20, 
and the programs where I try to open a 3.3 context gives me errors.

然而,这个网站https://developer.apple.com/graphicsimaging/opengl/capabilities/指出HD 4000应该支持4.1。那仅适用于glsl还是有任何方法可以使用FreeGLUT?我想使用freeGlut的原因是因为我现在正在学习的课程需要在他们的计算机上进行编译,并且他们正在使用FreeGlut,我希望能够在家工作。

1 个答案:

答案 0 :(得分:2)

只有在您请求核心上下文时,MacOS X才支持OpenGL-3.2及更高版本的上下文。你必须使用

初始化FreeGLUT
glutInitContextVersion(3,2); /* or later versions, core was introduced only with 3.2 */
glutInitContextProfile(GLUT_CORE_PROFILE);

另一个解决方案是https://stackoverflow.com/a/13751079/524368