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;
Edit:
Something I forgot to mention which seems to be relevant to most *nix users using freeglut is regarding depth testing,i,e what should be drawn( and what shouldn't) of a mesh from a particular view point:
To use depth testing on Linux, you not only need to enable depth testing via
(glEnable(GL_DEPTH_TEST);
but you also need to create your glut context to have a depth buffer (Windows seems to usually have a depth buffer by default, Linux doesn't).
Using freeglut that means you need to include GLUT_DEPTH
in glutInitDisplayMode so that it creates the context to have a depth buffer, e.g.
glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB|GLUT_DEPTH);
p.s. I have only been using freeglut because the college module I took gave us demo code to run using it. Since then I would definitely recommend switching to glfw instead. The first part of my answer still pretty much applies, just with glfw methods instead.
OpenGL version string: 3.0 Mesa 8.0.4 and OpenGL shading language version string: 1.30
. Does anybody succeed to at least OpenGL 3.3? – Paunchy