1

I'm working on building a 3D game engine with OpenGL on Linux. More specifically I'm using lwjgl-2.9.3 (the latest version isn't available for Linux at the time of this writing). I have built some of the project on a Windows 10 machine and it compiles and works just fine. However, it is no longer feasible for me to continue to use the Windows machine, and my own computer runs Fedora 24. I have an Intel Core i3-4012Y CPU and am using the integrated graphics with the mesa 12.0.3 driver. This is a laptop, with no option for adding in a dedicated GPU. When I tried working with the project on Linux (exact same code, I didn't change anything from what I copied off of the Windows computer), Eclipse gives me this error:

0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

I checked my OpenGL/Mesa information with this terminal command: glxinfo | grep OpenGL.

This is the output of that command:

OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Haswell
OpenGL core profile version string: 3.3 (Core Profile) Mesa 12.0.3
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 12.0.3
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 12.0.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:

I don't understand why my program won't compile. The 12 series Mesa drivers seem to support OpenGL 4.x and recent GLSL versions, correct? Is there a way that I can make this program compile? Do I need to get new drivers? At the time of this writing I'm pretty sure that I have the absolute latest drivers.

Additionally, the Mesa driver is the one provided in the Fedora repos, not one I compiled separately.

Any suggestions would be appreciated, as I am at a complete loss. Thank you.

mindriot
  • 5,413
  • 1
  • 25
  • 34
briguyjm
  • 43
  • 1
  • 3
  • 12
  • I suggest picking a look at [SIGGRAPH University : "An Introduction to OpenGL Programming"](https://www.youtube.com/watch?v=6-9XFm7XAT8) – Flint Oct 14 '16 at 20:43

1 Answers1

4

You must request an OpenGL core context.

With the current version of Mesa, if you do not request a core context, you get an OpenGL 3.0 compatibility context. If you do request a core context, you get an OpenGL 3.3 core context (or possibly newer) and you can use GLSL 3.30.

Similar behavior applies to OpenGL on macOS, except you get either 3.3 or 4.1 core contexts, and you get a 2.1 context otherwise.

See LWJGL Version Selection:

ContextAttribs contextAtrributes = new ContextAttribs(3, 2)
    .withProfileCore(true);

Please ignore the wiki's suggestion to use withForwardCompatible(), that functionality is somewhat obsolete.

Dietrich Epp
  • 205,541
  • 37
  • 345
  • 415