Ogl programming w/ a NVIDIA card

Started by
8 comments, last by Wymsical 22 years, 5 months ago
kk, i''m a complete newbie to linux, i just got it setup last night (had to compile my geforce drivers) so please bear with me. I tried compiling lesson 2 from nehe and it complained about me not having gl.h, and glu.h. i found gl.h and glx.h in /usr/include/ but also in the nvidia''s directory, i assumed i should use nvidia''s version since i recompiled and am using nvidia''s glx. but they didn''t have glu.h. what is that glu.h anyways? its like half way between gl and glut, but is neither. and where can i get the proper libraries and headers for ogl? thx in advance The wymsical wyvern
Advertisement
GLU is part of openGL, while GLUT isn''t exactly.

GLU has several function to make your life easier. Exemple, while glOrtho is in the base GL library, gluOrtho2D is in GLU.

It''s all things like that.

As for where to find them ...
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
quote:Original post by Wymsical
kk, i''m a complete newbie to linux, i just got it setup last night (had to compile my geforce drivers) so please bear with me.

I tried compiling lesson 2 from nehe and it complained about me not having gl.h, and glu.h. i found gl.h and glx.h in /usr/include/ but also in the nvidia''s directory, i assumed i should use nvidia''s version since i recompiled and am using nvidia''s glx. but they didn''t have glu.h. what is that glu.h anyways? its like half way between gl and glut, but is neither. and where can i get the proper libraries and headers for ogl?

thx in advance

The wymsical wyvern


What it is telling you is that linux compiler can not found gl.h and glu.h in directories it looked.

Try find some easy tutorials how to compile files in linux and how to use -L -I and -l in gcc.

When you can compile lesson2 in command line find tutorial how to use makefile and try change makefile in lesson2.

You can use either original gl.h or nvidia gl.h , if you want to use some nvidia special gl stuff then you mast use nvidia ones.

Information about glu can be found at http://www.opengl.org/developers/documentation/glx.html?glu#first_hit

;jackz

ps. gcc lesson2.c -o lesson2 -I/usr/include -L/usr/X11R6/lib -lGL -lGLU might work.




its not that i want to use nvidia''s gl, its do i have to? i''m asking this cuz i had to compile the glx and some kernel thing for the nvidia drivers, i thought nvidia might want me to use their libraries.


i did a :
find /usr -name glu.h -print
and it came up with nohting
since nvidia doesn''t supply the utility library, should i just use what sgi puts up?

the only files nvidia supplied are: gl.h and glx.h

The Wymsical Wyvern
If you want to use full hardware acceleration, you want to use nvidia''s drivers.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
So how will that affect users that dont use a Nvida card? I use one but I am sure everyone dont.
and by "using nvidi''s drivers" do you mean use their libraries too? if so, what do i do about glu.h if they don''t give it to me?
quote:Original post by Wymsical
and by "using nvidi''s drivers" do you mean use their libraries too? if so, what do i do about glu.h if they don''t give it to me?


when you use ''nvidia drivers'' you use libgl made by nvidia.
They can use hardware acceleration. (this needs nvidia-glx)

If you use some other libgl they can not use hw acceleration in nvidia card. They change 3D -> 2D and then use X libraries to draw picture to screen.

if you compare mesa-gl.h and nvidia-gh.h they are almous same.
There are some nvidia specific call in nvidia-gl.h.

If you only use basic opengl calls you can use mesa-gl.h with nvidia-libgl but there might be some problems in some opengl extensions.

You can use any glu , look mesa pages for it.
If I remember right glu only use gl calls for drawing so it can use any gl binaries (mesa or nvidia). This is same with glut.

This is hard to explain put maybe you get it.

;jackz





Right, here is the link to the Mesa download
http://sourceforge.net/project/showfiles.php?group_id=3

You have GLU at the end of the page.
thx!that clears everything up for me

This topic is closed to new replies.

Advertisement