OpenGL version outdated? [Solved]

Discussions Regarding Software

Moderator: Moderators

OpenGL version outdated? [Solved]

Postby King_DuckZ » Wed Feb 15, 2012 0:26

Hello guys, I must admit I'm a bit confused about this, but I'm trying to write an OpenGL 3.1 program and I'm having issues. In my CMakeLists.txt I put opengl >=3 as a compulsory requirement, and cmake succeeds, which makes me think that I do have at least opengl 3.0. Then I found this thread where they basically say to locate libGL.so and check the version there, which should be at least 3. Here's what I get:
Code: Select all
/usr/lib32/libGL.so
/usr/lib32/libGL.so.1
/usr/lib32/opengl/ati/lib/libGL.so
/usr/lib32/opengl/ati/lib/libGL.so.1
/usr/lib32/opengl/ati/lib/libGL.so.1.2
/usr/lib32/opengl/nvidia/lib/libGL.so
/usr/lib32/opengl/nvidia/lib/libGL.so.1
/usr/lib32/opengl/nvidia/lib/libGL.so.290.10
/usr/lib32/opengl/xorg-x11/lib/libGL.so
/usr/lib32/opengl/xorg-x11/lib/libGL.so.1
/usr/lib32/opengl/xorg-x11/lib/libGL.so.1.2
/usr/lib64/libGL.so
/usr/lib64/libGL.so.1
/usr/lib64/opengl/ati/lib/libGL.so
/usr/lib64/opengl/ati/lib/libGL.so.1
/usr/lib64/opengl/ati/lib/libGL.so.1.2
/usr/lib64/opengl/nvidia/lib/libGL.so
/usr/lib64/opengl/nvidia/lib/libGL.so.1
/usr/lib64/opengl/nvidia/lib/libGL.so.290.10
/usr/lib64/opengl/xorg-x11/lib/libGL.so
/usr/lib64/opengl/xorg-x11/lib/libGL.so.1
/usr/lib64/opengl/xorg-x11/lib/libGL.so.1.2

Isn't this horribly obsolete crap from the past decade?
And from eselect:
Code: Select all
$ eselect opengl list
Available OpenGL implementations:
  [1]   ati
  [2]   nvidia *
  [3]   xorg-x11

$ eselect opengl version
Version 20110818

So what version do I really have? Is the nVidia driver well updated on this? What about header files (GL/gl.h), are they up-to-date?
The red book says that due to the new depreciation system one should rather include <GL3/gl3.h>, which I don't have. The book does make a distinction with glext.h that should be downloaded separately, while gl3.h should be there. Is something wrong or am I just missing some package? :S http://www.opengl.org/wiki/Deprecation

gcc is complaining about glBindBuffer and glBufferData not being defined, I'm still checking what other mistake I could've made but the version thing is bugging me anyways.
King_DuckZ
Simple Hen
 
Posts: 68
Joined: Wed Sep 07, 2011 0:46

Re: OpenGL version outdated?

Postby micia » Wed Feb 15, 2012 11:08

To check your OpenGL version run:
Code: Select all
glxinfo | grep version


among other results, you will get a line starting with:
OpenGL version string

that contains your OpenGL version.

You can also get the OpenGL version right from your application with the glGetString() function, with GL_VERSION argument, as specified in the Red Book.
micia
Sagely Hen
 
Posts: 2718
Joined: Wed Nov 26, 2008 16:41

Re: OpenGL version outdated?

Postby King_DuckZ » Wed Feb 15, 2012 14:05

Thanks, I didn't know about the glxinfo command. And indeed, the output of my program is "openGL initialization successful - 4.2.0 NVIDIA 290.10", but then I don't understand why I don't have gl3.h. In the examples it's included with angular brackets <>, so I take it it should be in a system path. Should I download it separately instead? (I'm speaking of the whole GL3 subset, not just gl3.h).
King_DuckZ
Simple Hen
 
Posts: 68
Joined: Wed Sep 07, 2011 0:46

Re: OpenGL version outdated?

Postby DontPanic » Thu Feb 16, 2012 23:23

I did a little Googling. I don't think a final version of gl3.h has been released yet.

I downloaded what appears to be the most recent version of gl3.h, and it explicitly requests not to be repackaged since it still may change.

http://www.opengl.org/registry/api/gl3.h

I think most people who are developing for OpenGL 3 are still manually obtaining gl3.h.

Let us know if you find out differently.
Gigabyte GA-P35-DS3L - Intel(R) Core(TM)2 Duo CPU E6750@ 2.66GHz
nVidia GeForce 7600 GS
2 GB RAM
DontPanic
Old Dear Hen
 
Posts: 742
Joined: Mon Jul 09, 2007 20:29
Location: Mobile, AL, USA

Re: OpenGL version outdated?

Postby micia » Sat Feb 18, 2012 11:02

When coding in OpenGL3 you might want to manually obtain OpenGL 3 API functions, by using glXGetProcAddress() or equivalent functions on different platforms or libraries, this will improve compatibility (since you can still be able to provide a pre-OpenGL3 compatibility by doing this). Anyway, as far as I know, the situation is exactly the same described by DontPanic.
Of course, if you plan to only support OpenGL3, you have to wait for a definitive version of gl3.h.
micia
Sagely Hen
 
Posts: 2718
Joined: Wed Nov 26, 2008 16:41

Re: OpenGL version outdated?

Postby micia » Wed Feb 22, 2012 13:20

Since all questions appear to have been answered and there has been no more activity on this topic, I am going to mark this as solved, as described in:
:arrow: viewtopic.php?f=59&t=17059
micia
Sagely Hen
 
Posts: 2718
Joined: Wed Nov 26, 2008 16:41


Return to Software in General

Who is online

Users browsing this forum: No registered users and 3 guests