How to enable OpenGL 3.3 using Mesa 10.1 on Ubuntu

三世轮回 提交于 2019-11-27 14:31:06

What they do not tell you, but indirectly imply ("Some drivers don't support all the features required in OpenGL 3.3."), is that in the last official release of Mesa (10.0), GL 3.3 only works on Intel hardware. This is one of the joys of Intel's close involvement with the Mesa project. If you want reliable GL 3.3 support in any form on AMD hardware, you should use fglrx (the proprietary AMD driver) for the time being.


The development release of Mesa 10.1 may implement GL 3.3 on radeon drivers, but you need to request a 3.3 core profile. You are not doing this currently.

This:

glfwOpenWindowHint(GLFW_OPENGL_PROFILE, 0);

Actually needs to be this:

glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);

Also, there is no such thing as a GL 3.0 compatibility profile or 3.1 core profile. Profiles were not introduced into OpenGL until 3.2. There is a concept of GL_ARB_compatibility in GL 3.1, but that is not the same thing as a profile; glxinfo is giving misleading information.

I answered the thread OP mentions regarding "OpenGL & GLSL 3.3 on an HD Graphics 4000 under Ubuntu 12.04" but I thought I would give the same answer here too considering info seems so scarce. This works for those using freeglut and glew:

so Ive seen a lot of threads surrounding this and I thought here would be a good place to respond. Im running Ubuntu 15.04 with intel ivybridge. After using the "Intel Graphics installer for linux" application, glxinfo gives the following info regarding openGl:

OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.6.0
OpenGL core profile shading language version string: 3.30
OpenGL version string: 3.0 Mesa 10.6.0
OpenGL shading language version string: 1.30

Now from this you can see that the core profile and glsl version are 3.3,but compatible openGl is only 3.0 thus if you want your code to run with 3.3 you need to specify both an opengl core profile and a glsl core profile. The following steps should work if youre using freeglut and glew:

-the glsl #version should specify that you want the core profile:

#version 330 core

-specify you want opengl 3.3:

glutInitContextVersion (3, 3);

-and finally set glewExperimental to true before glewInit():

glewExperimental = GL_TRUE;

hope this helps some people get started :)

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