OpenGL 2.0+ on Linux?

So, the standard libgl1-mesa-dev libraries that come with linux only have OpenGL 1.4

I want to code a custom shader. Is it possible to get some OpenGL 2.0+ libraries on Ubuntu? If so, how?

If you’re on NVIDIA, install the NVIDIA drivers. It’s been a while since I did this on Ubuntu, but the installation panel generally lets you do this.

If you’re on ATI, you can install the ATI Catalyst drivers. But you can also install the open-source drivers that people have implemented. They’re open source, if you’re into that sort of thing, but not as good (yet?) as the Catalyst drivers.

I have installed the proper drivers, but #include <GL/glut.h> still gives me an old version.

For glut, install freeglut-dev, this is different from GL.
Then, how do you know the Gl version ?
To access modern GL features, use a library like GLEW unless you really understand the difference between an ABI and an API.

I know that it’s an old version because, when I looked at gl.h it only had

#define version_1_4 1

(not anything higher than that) and because OpenGL would recognize the command glLoadShader()

But when I get back to the computer I’ll try installing freeglut-dev

That’s just the header. You still have to load function pointers for higher OpenGL versions. Download and use GLEW.

Isn’t GLEW for extensions? glLoadShader() comes build in to any version higher than 1.4

Isn’t GLEW for extensions?

No.

Since you are on Linux and using nvidia driver, you dont really need to use GLEW to load anything.

Just do:


#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/glext.h>

And link to libGL.so

Its still a good idea to use some kind of loader (GLEW or your own) in production code, as you can react to extensions being unavailable.

also, just sayin’, you can check the version number with the “glxinfo” command, so, the command “glxinfo | grep version” shows:

[user@computer ~]$ glxinfo | grep version
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
OpenGL version string: 3.3.0 NVIDIA 270.41.19
OpenGL shading language version string: 3.30 NVIDIA via Cg compiler

can anyone plz help in installing open gl in ubuntu 11.04
its very urgent for my project.
i am stuck with it for nearly a month.
i have ati graphics card.

plz tell me what all libraries and drivers needed to be inatalled.
and how to install them.
plz note that i am a new linux user.
plz reply fast …
just very very urgent.

thank you.
thanks a lot, a ton.

Everything to run GL apps up to OpenGL 2.1 already comes with Ubuntu 11.04:

a) Mesa
b) the Xorg radeon driver and kernel module

Run glxinfo from a console and see what it reports.

If you want to develop a GL app under Ubunut, open a console and type in ‘apt-get install libglew1.5-dev’.

There you go.

thanks for your help
but its not solving my purpose.

actually, i am writing a program in c which will need opengl to draw few lines.

i have tried many ways installing various packages, but didnt got opengl installed…

can u plz guess whats the problem and show me some way…

thanks.

I think you’ve got some things mixed up. You don’t install OpenGL. You install OpenGL capable drivers which provide an implementation of the OpenGL specification.

When you develop something using an OpenGL implementation, you need to either get functions pointers of the GL functions you need, or you use a library like GLEW.

Please tell us exactly what you do. What does glxinfo report? (Please omit the huge table, only thetop part with text and version numbers etc. is important)

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.