PDA

View Full Version : How to develop on Linux/NVIDIA



omm123
06-15-2000, 02:42 PM
Benn ff. the interesting thread "Extensions and NVIDIA GLX", but it doesn't entirely answer my question. I thought I'd move mine to a new thread.

My questions is simple: what files do I need (headers as well as shlibs) to devel GL apps for Linux with the NVIDIA hardware. Let's assume that I have a bare XFree86 4.0 installation and the libs from NVIDIA (libGL.so, libGLcore.so and libglx.so), what other files would I need to compile a GL app, say, like the GL apps in xscreensaver?

Thanks in advance for any replies.

jmeinhorn
06-19-2000, 03:34 AM
The same files are needed for pretty much all video cards. Usually you need at least the following libraries for simple development. libGL.so, libGLU.so and libglut.so. You will also need the corresponding header files. GL.h, GLU.h and glut.h.

omm123
06-19-2000, 04:26 PM
Originally posted by jmeinhorn:
The same files are needed for pretty much all video cards. Usually you need at least the following libraries for simple development. libGL.so, libGLU.so and libglut.so. You will also need the corresponding header files. GL.h, GLU.h and glut.h.

In my case where I have a fresh install of XFree 4.0 and the NVIDIA drivers (which come with a libGL, libGLcore and libglx), what additional files should I get? If you say Mesa, should I use the libGL.so that comes with Mesa?

Obviously, my problem is that I have no idea what each lib contains. ;-)

mallan
06-19-2000, 07:12 PM
Originally posted by omm123:
If you say Mesa, should I use the libGL.so that comes with Mesa?


You can use the Mesa header files, libGLU and libglut, but you definitely don't want to use the Mesa libGL. I would recommend doing a complete install of Mesa and associated libraries and make sure you can compile and run OpenGL applications (in software). Once everything works, install the NVIDIA driver to get hardware acceleration.

libGL is the guts. libGLU is a utility library which contains convinience functions. Neither of these libraries deal with any platform specific things like opening windows, mouse input, etc. libglut is the 'utility toolkit' that allows a cross platform way to open windows, read mouse and keyboard input, and a bunch of other stuff.

When building GL apps, you'll have to link to some X libraries as well. The link line for a minimal glut program would look something like this:
-lglut -lGLU -lGL -lXmu -lXext -lX11 -lm

Cheers,
Mark

jmeinhorn
06-20-2000, 05:43 AM
I've been able to do several simple programs by just using -lglut -lGLU -lGL. I'm not sure when the others become necessary. I'm pretty sure that the -lm is when you include the more complicated math stuff(i.e. math.h). Do you know what kind of stuff requires the -lXmu -lXext -lX11? I've been waiting for for mesa3.3 to be released before I try to develop on my nvidia machine(The xfree4.0 stuff is built using some parts of mesa3.3). Let me know if ya get it to work though.

omm123
06-20-2000, 08:50 PM
Originally posted by jmeinhorn:
Do you know what kind of stuff requires the -lXmu -lXext -lX11? I've been waiting for for mesa3.3 to be released before I try to develop on my nvidia machine(The xfree4.0 stuff is built using some parts of mesa3.3). Let me know if ya get it to work though.

All I know is that those libs are specific to X windows development. I've seen the O'Reilly book on X libs and development and am not too crazy about going that low level. There are other libs around which make GUI applications easier (ie. GTK+, QT, FLTK, etc.)

Do you have any idea when Mesa3.3 will be released?

With regards to NVIDIA and OpenGL, it looks like I have to wait for a while since when I tried using libGL from NVIDIA instead of the Mesa version, my X SIGSEGV'd and dropped core. Must be incompatible with my system. Gnuts!

jmeinhorn
06-21-2000, 06:25 AM
I have seen that XFree4.01 is froze and should be released shortly. I would imagine that we would see a lot of people repackage(redhat) and hopefully they will include the new mesa stuff at that time. http://dri.sourceforge.net/resources/resources.html. Until then grab the new librairies from this link. They will most likely work better than the ones you tried to install. You should only need the glut lib and headers and the GLU lib and headers. Your xServer should provides the libGL.so which is were all the hardware accelleration comes from it would seem.

omm123
06-21-2000, 06:43 AM
Originally posted by jmeinhorn:
http://dri.sourceforge.net/resources/resources.html. Until then grab the new librairies from this link.

I must say this: THAT DID THE TRICK! I was able to get my GL apps to work with hardware 3D-rendering. I didn't recompile my app, just used the libs from that link. I wonder why such a simple yet very effective tip isn't on any of the sites which discuss NVIDIA and XFree 4.0 (of course, it could be my compiled Mesa 3.2 and compiler flags that messed up)

Thanks! :-)