Complete Newbie -- please help

I have basic coding skills, learned to code in Ada and Pascal … just starting to get into C / C++ … and want to do some OpenGL … simple stuff to start learning … anyway … i am new to all this and am at a complete loss to comprehend the differences between OpenGL programming in C and C++ … (side note: in coding for RH Linux 7.1)

now as far as i understand it, there are different windowing commands for windows and Xwindows … but im even more confused with the differences between OpenGL in C and C++ … i want to use C in Xwindows … I have OpenGL superbible book … but i dont know if this is specific to windows and C++ … i guess my major questions are … how do i tell the difference … and what do i need to learn OpenGL in C for Linux … some please help … im soo lost … but its prob just me … if anyone can answer my questions or point me in the right direction … it would be much appreciated

thank you very much for your help and time,

-Eryk Furman

Originally posted by ekfcipher:
[b]I have basic coding skills, learned to code in Ada and Pascal … just starting to get into C / C++ … and want to do some OpenGL … simple stuff to start learning … anyway … i am new to all this and am at a complete loss to comprehend the differences between OpenGL programming in C and C++ … (side note: in coding for RH Linux 7.1)

now as far as i understand it, there are different windowing commands for windows and Xwindows … but im even more confused with the differences between OpenGL in C and C++ … i want to use C in Xwindows … I have OpenGL superbible book … but i dont know if this is specific to windows and C++ … i guess my major questions are … how do i tell the difference … and what do i need to learn OpenGL in C for Linux … some please help … im soo lost … but its prob just me … if anyone can answer my questions or point me in the right direction … it would be much appreciated

thank you very much for your help and time,

-Eryk Furman[/b]

First learn some C or C++ stuff. There are some tutorials in net or get some good book.

It’s easier to learn OpenGL if you first know
how C / C++ systax goes and how to make some simple C/ C++ programs.

If you want to do OpenGL programs, you can do them using pascal. There are some free pascal compilers for linux.

Read my answer to ->
http://www.opengl.org/discussion_boards/ubb/Forum4/HTML/000366.html How to create
a window in X there you find some good places
for examples for linux.

Thanks for the tips,

I really dont want to use Pascal, my goal is to grow and learn C / C++ programming as well as delv into OpenGL and not fallback to a comfortable laguage just to do OpenGL.

I am learning C as I go. Im writing very simple apps using Glade to create the interfaces and build source in C. (I tried to get it to output in C++ but somewere between glade–, gtk–, gnome–, and libsigc the code that glade outputs doenst compile …) anyway … i can make the widgets do simple things like show other windows or change labels or entry text boxes … now i want to add some basic code to read write data from a file which i will code in C and then want a very simple OpenGL display area or window incorporated into the app so it would have to be done with a C wrapper for OpenGL (correct me if im wrong on that) … now the C++ wraper for GTK+ (GTK–) uses a different syntax … a more C++ like syntax … and i assume it is the same for OpenGL … if that is the case … i need to find C specific OpenGL tuts (as well as X windows specific) and all the docs i found just speak of OpenGL as if it is universal syntax …this is what im confused with.

-Eryk

Hi !

Both Mesa and GLUT comes with lots of examples in C, might be worth having a peek at those maybe ?

Mikael

Thanks, just so i have it right, (which i dont think that i do) Glut is a sub set or a wraper for OpenGL to make some calls easier … that, i think i got … but Mesa is a Linux higher level wrap for OpenGL or a rewrite … another words its not put out by SGI?? its possible to code OpenGL without Glut … right? is there a strait or “true” OpenGL port for linux? ? or is Mesa basically the standard … GLX is a Mesa-based library … as is Glut … do i have some of that right? im trying to stick with standard OpenGL … from what i gather the calls for Mesa are same as in OpenGL … ??? how far off am I?

Thank you for all the help …

-Eryk

Originally posted by ekfcipher:
[b]Thanks, just so i have it right, (which i dont think that i do) Glut is a sub set or a wraper for OpenGL to make some calls easier … that, i think i got … but Mesa is a Linux higher level wrap for OpenGL or a rewrite … another words its not put out by SGI?? its possible to code OpenGL without Glut … right? is there a strait or “true” OpenGL port for linux? ? or is Mesa basically the standard … GLX is a Mesa-based library … as is Glut … do i have some of that right? im trying to stick with standard OpenGL … from what i gather the calls for Mesa are same as in OpenGL … ??? how far off am I?

Thank you for all the help …

-Eryk [/b]

Hi,

Glut is extension to OpenGL, It make some things easier to do. You could say that it it collects some GL calls behind one glut call. You can do that collection yourself, but its easier to do with glut.
Use some search engine to find information about glut and decide if you want to use it.
You do not need to but its makes your life easier.

Mesa is free alternative to OpenGL. It’s 100 % compatible to OpenGL but it is not licensed because that cost money.
Mesa is ‘standard’ opengl for linux use.

check information for mesa from net.

GLX is one way how opengl programs ’ talks’ to graphics card. It’s a protocol for 3D commands. Find more info from net.

When you write ‘standard’ OpenGL program in linux you include gl.h.
This gl.h can be gl.h with came with XFree86 if you use 4.x.x, its mesa based.
this gl.h tells what opengl calls look like.

it does not matter if that gl.h is made by mesa or sgi if those calls are same.

When you compile the program, GL libraries are connected to your programs.
those libraries then calls other and finally graphics card draw picture.

GLX is one of those libraries and it can use hardware acceleration in your card.

It’s not easy to explain when english is your second language and you can not draw picture.

Try find some information how X draw pictures and what ways there are to do it.

Thanks jackz,

I know it can be difficult to explain these concepts … and your right with out pictures … or diagrams … but thank you … the explanation was very helpfull … no i know what direction to go in …

do the calls for Mesa very between C / C++? do you or anyone else know where to find a list of the calls for Mesa in C … wait i think i just answered my question … the API specs for Mesa should do it …

but if Glut works ontop of OpenGL … on linux does it work ontop of Mesa … or is Glut different … then Mesa … from what is sounds like they are …

Thanks again ,

P.S. your english sounds great to me ! … out of curiosity what is your first language?

-Eryk

Originally posted by ekfcipher:
[b]Thanks jackz,

I know it can be difficult to explain these concepts … and your right with out pictures … or diagrams … but thank you … the explanation was very helpfull … no i know what direction to go in …

do the calls for Mesa very between C / C++? do you or anyone else know where to find a list of the calls for Mesa in C … wait i think i just answered my question … the API specs for Mesa should do it …

but if Glut works ontop of OpenGL … on linux does it work ontop of Mesa … or is Glut different … then Mesa … from what is sounds like they are …

Thanks again ,

P.S. your english sounds great to me ! … out of curiosity what is your first language?

-Eryk[/b]

The syntax to call to mesa/opengl is same in c and c++ but the way you do is differend.

in C you do something like ->
main()
{

draw_triangle ( ***) ;

}

draw_triangle (****)
{

glBegin ( );
glVertex3f( ,,
);
glVertex3f(
,*, );
glVertex3f( ,,
);
glEnd();

return();
}

in C++ you can do same, but you can also make some class and call it

class draw
{
public:

triangle (***);

);

void draw:trtiangle ()
{

glBegin ( );
glVertex3f( ,,
);
glVertex3f(
,
*, );
glVertex3f( ,,
);
glEnd();

}

void main ()
{

draw test ;

test.triangle(**');

}

If you have book you can find those call there, else there are some collections in net.
maybe www.mesa3d.org or somewere in www.opengl.org.

You can use glut with mesa, same way you would use it with official opengl.
you can think that mesa = opengl .

check
http://www.opengl.org/developers/index.html

there is lot of useful information.

ps. my first language is finnish.

Thanks … yeah its making sense now … see i got the book, “Linux 3D Graphics Programming” written by Norman Lin and it talked about both using OpenGL and Mesa on linux which confused me … i guess what they were saying is … you are using OpenGL on linux its just not a licenced ver of the OpenGL libraries and because of that … is called Mesa and not OpenGL. So i can use my OpenGL bible book … for pure OpenGL calls … but things that are C specific is still a little hazy … i guess i thaught there would be some central source that describes the language specific calls for Mesa for C …(thats the other problem the book talks about C++) like a spec white paper or something … or do people just basically learn from other peoples code …

yeah … i guess it will start makeing sense … when i start trying to code simple thigs and look at the examples that came with Mesa …

thanks again

was anyone else as confused as me when they first started with 3D programming for Linux?

-Eryk

OK wait … confused again … on : http://www.mesa3d.org/docs/README

it says that :

“…it is important to understand that Mesa is not a real implementation of OpenGL
since it is not licensed. That said, Mesa is still a viable alternative
to OpenGL.”

if it is an alternative … are there licenced libraries from SGI for Linux? Like they have with windows …

hahaha but then it goes on to say … that:

“Since the OpenGL API is used, OpenGL documentation can serve as the documentation for Mesa’s core functions.”

so basically SGI didnt port it to Linux … so we had to do it our selves …

-Eryk

me again …

jackz,

i just looked over your example again … and i was like duhhh … the Mesa calls are same as OpenGL calls on any other system … and the only diffences between the C and C++ ver you gave were the language specific ways to declar functions and everything else in programming not related to OpenGL / Mesa are just like normal language syntax …

ok … i think i got that … just still a little miffed about Mesa and OpenGL … but as far as that goes … i figure all i need to do is use Mesa libraries in my prog … follow OpenGL syntax and shut up … heheh

-Eryk

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