OpenGL vs MESA

I was wondering why in the Linux world we must use MESA instead of OpenGL? Is MESA identical to OpenGL? Also, why is MESA behind in version numbers compared to OpenGL?

thanks,
mike

Mesa3D provides an OpenGL implementation, just like NVidia’s, AMD’s, or Intel’s drivers provide an OpenGL implementation. They are all OpenGL implementations. Like Ford, Buick, and Toyota are all types of cars.

You don’t have to use Mesa3D’s OpenGL implementation. You can install another by installing your GPU vendor’s driver, if they offer one. I personally use NVidia’s on Linux. Works great!

A separate issue is that Mesa3D also provides (in addition to an OpenGL implementation) their own version of the GLU OpenGL utilities library. You can use that irrespective of which underlying OpenGL implementation you choose to run. It’s not tied to one or another (AFAIK).

[QUOTE=Dark Photon;1244172]Mesa3D provides an OpenGL implementation, just like NVidia’s, AMD’s, or Intel’s drivers provide an OpenGL implementation. They are all OpenGL implementations. Like Ford, Buick, and Toyota are all types of cars.

You don’t have to use Mesa3D’s OpenGL implementation. You can install another by installing your GPU vendor’s driver, if they offer one. I personally use NVidia’s on Linux. Works great!

A separate issue is that Mesa3D also provides (in addition to an OpenGL implementation) their own version of the GLU OpenGL utilities library. You can use that irrespective of which underlying OpenGL implementation you choose to run. It’s not tied to one or another (AFAIK).[/QUOTE]

Ok, where do I get the nVidia implementation. I looked all over their site and all I see are .exe’s.

Google nvidia driver download and the link comes right up.

Usually though you can just install it through your distro’s package manager. Often that’s simpler. Google your distros name + nvidia driver install for details.

(This isn’t 100% accurate but it gets the point across)

You wouldn’t be trying to develop for a newer version of OpenGL are you?
Trying to access new features, or maybe just worried about performance?

It’s the new version development libraries you want isn’t it?

Well my friend it’s GLEW you want!
http://glew.sourceforge.net/

This is a library that gives you entry points into the newer features of OpenGL such as the functions:

glEnableClientState, glVertexPointer

OpenGL itself is a specification to render fancy graphics to a video card.

There are different implementations to it such as MESA, nVidia’s OpenGL, ATI OpenGL, Microsoft OpenGL. Some of these such as MESA, are software implementations. They do 3D rendering completely on your computer and do not take advantage of your fancy video card at all. Others like the nVidia, will take full advantage of the video card, the nVidia drivers will access the specific video card model and hand off the processing to it.

Okay, easy enough right. Now why do you keep seeing MESA pop up, and why is your program so sloooow?

on your computer you’ll see windows/opengl32.dll, i believe this is the Microsoft software implementation. Slow and it’s probably the OpenGL 1.1 specification. It wont have any new functionality at all. Somewhere else you’ll have a opengl.dll that comes from nVidia, this is the one you want… but
when you link opengl32.lib (microsoft visual c++) to your program, you are linking a static library, that accesses the dynamic library(opengl32.dll) that is the microsoft implementation. You don’t want to do this. You want to link against a static library that will access the more modern opengl32.dll. GLEW is a multiplatform library written by opensource people, that will allow you to access new OpenGL features on any platform.

You want to download and copy the .DLL filse to /windows/system32
the library and include files to their respective folder in your compiler.

Are you using Visual C++?

[QUOTE=dirk103;1244175](This isn’t 100% accurate but it gets the point across)

You wouldn’t be trying to develop for a newer version of OpenGL are you?
Trying to access new features, or maybe just worried about performance?

It’s the new version development libraries you want isn’t it?

Well my friend it’s GLEW you want!
http://glew.sourceforge.net/

This is a library that gives you entry points into the newer features of OpenGL such as the functions:

glEnableClientState, glVertexPointer

OpenGL itself is a specification to render fancy graphics to a video card.

There are different implementations to it such as MESA, nVidia’s OpenGL, ATI OpenGL, Microsoft OpenGL. Some of these such as MESA, are software implementations. They do 3D rendering completely on your computer and do not take advantage of your fancy video card at all. Others like the nVidia, will take full advantage of the video card, the nVidia drivers will access the specific video card model and hand off the processing to it.

Okay, easy enough right. Now why do you keep seeing MESA pop up, and why is your program so sloooow?

on your computer you’ll see windows/opengl32.dll, i believe this is the Microsoft software implementation. Slow and it’s probably the OpenGL 1.1 specification. It wont have any new functionality at all. Somewhere else you’ll have a opengl.dll that comes from nVidia, this is the one you want… but
when you link opengl32.lib (microsoft visual c++) to your program, you are linking a static library, that accesses the dynamic library(opengl32.dll) that is the microsoft implementation. You don’t want to do this. You want to link against a static library that will access the more modern opengl32.dll. GLEW is a multiplatform library written by opensource people, that will allow you to access new OpenGL features on any platform.

You want to download and copy the .DLL filse to /windows/system32
the library and include files to their respective folder in your compiler.

Are you using Visual C++?[/QUOTE]

I’m using gcc on Linux Mint 13. I do have an nVidia card. So will GLEW be hardware accelerated by my nVidia card?

ok, I compiled and installed GLEW using make and make install. But now how do I use it? Inside my Makefile I used the following for MESA:


objects = main.o

cube: $(objects)
    g++ -o cube $(objects) -lX11 -lXi -lglut -lGL -lGLU -lm
    
main.o: main.cpp
    g++ -c main.cpp

Do I need to do something different? The GLEW page doesn’t mention much.

I’m not a %100 sure but try something like this:
Try without the -lGL
instead replace it with glew or maybe GLEW


objects = main.o

cube: $(objects)
    g++ -o cube $(objects) -lX11 -lXi -lglut -lglew -lGLU -lm
    
main.o: main.cpp
    g++ -c main.cpp


Do I need to do something different? The GLEW page doesn't mention much.

The GLEW post muddied the waters a bit. GLEW is just wrapper library over the OpenGL implementation. You can use it or not. It’s not required. And it has nothing to do with your Mesa vs. vendor driver OpenGL question.

Suggest you get the NVidia driver installed first. glxinfo will confirm you have done so.

I’m not looking for a driver. I’m looking for an API to develop in. I noticed that OpenGL is on version 4.3 while Mesa is on 3.1. I know that on Windows I’m able to use version 4.3 with the libraries that come with Windows. So I was wondering if I could get version 4.3 on Linux? Does this make sense or am I asking the wrong question?

mike

You are looking for a driver, because the driver is what implements the API. If you don’t have 4.3-capable drivers installed on Windows, you don’t get 4.3 support. Same goes for Linux.

Can’t be that difficult

Okay guys he has his video card drivers installed obviously, who doesn’t, especially if they’re programming. He’s worried he’s not developing using his video cards full potential.

The only drawback to using OpenGL 3.1 instead of 4.3 is you don’t have access to a few specialized hardcore features. 3.1 will be just as fast.