OpenGL 3.3 on OSX with FreeGLUT

南笙酒味 提交于 2019-12-02 13:26:38

问题


I am using the following configuration

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

My goal is to use OpenGL 3.3 using FreeGLUT, Is there a way to achieve that?

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.

However this site https://developer.apple.com/graphicsimaging/opengl/capabilities/ states that HD 4000 should support 4.1. Is that only for glsl or is there any way to use FreeGLUT? The reason I want to use freeGlut is because the course I am taking right now requires the assignments to compile on their computers, and they are using FreeGlut, and I would like to be able to work from home.


回答1:


MacOS X supports OpenGL-3.2 and later contexts only if you request a core context. You have to initialize FreeGLUT in addition with

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

Another solution is given at https://stackoverflow.com/a/13751079/524368



来源:https://stackoverflow.com/questions/21526662/opengl-3-3-on-osx-with-freeglut

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!