OpenGL, Mesa -- why?

Ok, i’m still a little confused on this ogl/mesa thing. It Mesa THE OpenGL implimentation for unices, or is it just the “free” version for these platforms. What is the official library used for ogl development under linux/unix.

what do i need.
ok, glx contains regular gl* functions/constants, and glx* X extensions.
so what libraries are need it this is all i am using (regardless of what windowing library I choose, ie glut…)
gl or glx or mesa, or all when linking.
i assume that glx.h is NEEDED for any X program because of the extensions…
thanks

Mesa is not an official port of OpenGL
It’s a free lib that is used in the same way as OpenGL, and which does the same.
GLX is the set of accelerated 3d drivers for XFree 3.3.?
DRI takes this role under XFree 4.0

You’ll need

  • Mesa devel files (*.h)
  • glx / Dri libs

Is DRI board independant.
What advatages does it have over glx (does this mean glx is obsolete)
what other implementations of OpenGL are there for linux besides Mesa, and is Mesa FULLY compatible with OpenGL 1.2 specs

DRI has modules for each 3d card family.
It is bound to replace GLX (which does not exist anymore under XFree 4.0).

Just use Mesa, it works perfectly.
I have never heard about some1 using another OpenGL lib under linux.

Originally posted by Sly:
DRI has modules for each 3d card family.
It is bound to replace GLX (which does not exist anymore under XFree 4.0).

That is not true, afaik. GLX is an extension to the X-Protokoll/libs to allow the use of OGL under X. And it definetely exists under XFree 4.0. It is used to create drawing contexts and to choose visuals where OGL is available.
DRI is afaik only a infrastructure to enables 3d cards to draw more or less directly to a window without having to pass all instructions to the xserver by the X-protokoll. “Direct rendering” is way faster than indirect rendering via the xserver.
Also, currently DRI drivers are only available for some few 3D cards. Checkout http://www.xfree86.org/4.0.2/DRI3.html for complete list.
Nevertheless NVidia provides own binary drivers which enable “direct rendering” without DRI and are very fast (near Windows, some say even above).

Originally posted by Sly:
Just use Mesa, it works perfectly.
I have never heard about some1 using another OpenGL lib under linux.[/b]

Yes, Mesa works good, but NVidia for example ships their own implementation of the OpenGL lib which currently is the only way of getting “direct rendering” and thus true hardware acceleration on these boards. So many people are in fact using other OGL libs under linux.

bxe Miq

Ok, I want to be able to write a an OGL
program, and distribute it as a binary.

I know Mesa is pretty much standard on all
linux machine (and more), but it is not opengl per say…so I dont want to use it.

That leaves glx, which to my understanding, contains both the glx extensions, and standard gl* function.

Now, that is all I have to do, correct.
If the user wants to use DRI or non-DRI gl runtime libraries, that is totally up to them.

As long as I link to libGL, it will look for this no matter what the underlining implementaion is. After, if my code follow opengl specifications, i shouldnt have a problem either way. If something is wrong, it’s the vendors fault…

Is that all correct?

Hi xerid,

Originally posted by xerid:
[b]Ok, I want to be able to write a an OGL
program, and distribute it as a binary.

I know Mesa is pretty much standard on all
linux machine (and more), but it is not opengl per say…so I dont want to use it.

That leaves glx, which to my understanding, contains both the glx extensions, and standard gl* function.

Now, that is all I have to do, correct.
If the user wants to use DRI or non-DRI gl runtime libraries, that is totally up to them.

As long as I link to libGL, it will look for this no matter what the underlining implementaion is. After, if my code follow opengl specifications, i shouldnt have a problem either way. If something is wrong, it’s the vendors fault…

Is that all correct?

[/b]

It is almost correct. In addition to glx you need a OGL library, be it Mesa or something else. For your purpose it does not really matter since Mesa is binary compatible to most other OGL implementations.
So as long you use standard OGL stuff you program should run on all reasonable linux systems with OGL installed. There may be cases where this is not true but I think that is the minority.

bxe Miq

One last question for this thread…I promise.

Ok, so if I use th glx source libraries, and gl source libraries, it doesnt matter what binary I link with.
does SGI provide opengl runtime libraries, or do they just encourage use of mesa.
also, how do I link it.
if I use -lMesa, then mesa is need on the users machine, but if I -lGL, then this will use whatever runtime libraries are available that are GL libs…if it is the manufactures, or the one that came with XFree with DRI - is this correct.
I guess i am having trouble seeing the entire picture…or all posible senerios.
In window, I just link with gl32.lib and the program looked for opengl32.dll - no matter who provided the actually dll file…

Can you walk through this…

you have to link with libGL. whether or not you use Mesa’s libGL or not, doesn’t really matter. just make sure you link with “-lGL” and not “-lMesaGL”.

i use Mesa’s libGLU and headers, and NV’s libGL. no problems at all.

and concerning glx, you don’t link explicitly with it. the glx lib is only used by the drivers (the X server), afaik. i’ve never seen anyone linking with it, and it doesn’t show up if i use ldd on an OpenGL app.

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