5

How i can install OpenGL 4.0 or 4.5 from terminal for developing in C++? I search about it but i can't find a source. And i do not have a directory named GL in usr/include.

A. Ite
  • 113

1 Answers1

3

Mesa is the GL library used. Ubuntu 16.04 includes Mesa 11.2 which supports OpenGL 4.1. Just install the libgl1-mesa-dev and mesa-common-dev packages to install the development files for it.

If you really need 4.5, you will likely need to develop against the propreitary AMD or NVidia drivers, and you will need a card which actually supports 4.5 to run any software you create using that version of the API.

dobey
  • 40,982
  • I do installation, but still i don't have GL directory in usr/include. – A. Ite Jul 06 '16 at 18:27
  • Sorry, I guess you also need mesa-common-dev. – dobey Jul 06 '16 at 18:33
  • I installed the above libraries but glxinfo | grep -i opengl still shows OpenGL version string: 3.0 Mesa 11.2.0. How do I develop in OpenGL4? – Shashwat Mar 19 '17 at 15:31
  • @Shashwat "core profile version string" tells you the OpenGL version currently supported by the Mesa drivers on your card. However, developing for OpenGL 4.x and having OpenGL 4.x support in your GPU are not the same thing. To develop for OpenGL 4.x, you would just need to use new APIs that are only available in 4.x. This would then not run on hardware that doesn't support 4.x, but it is independent of development for hardware that does. – dobey Mar 19 '17 at 20:12
  • So, do you mean that after installing the above libraries, I can just use the new APIs to develop in OpenGL 4.x - whether it's supported or not? Secondly, I have NVidia GeForce 920M graphics card but still the vendor is shown to be Intel Open Source Technology Center. How can I change that and have support for OpenGL 4.x? Thank you! – Shashwat Mar 19 '17 at 20:49
  • I have those libraries but when I print the opengl version string in the code, it shows 3.0 – 842Mono Oct 09 '17 at 13:40