opengl documentation ?

Hi,
i’m new to opengl programing and i am having troubles to simply find the documentation for it.

I have already made a few things with DirectX, and i wondered if there was a documentation similar to the one given with the DirectX sdk (this document contains the description of the DirectX functions, notes from authors, …, and i would need the same for opengl)

go to nividia’s page… www.nvidia.com

Well, i already went to nvidia’s site, but i don’t know what to take.

In fact, i am learning opengl init right now, and looking at some tutorials code, i see some functions and i wonder what they do… i would need a doc describing the opengl functions.

For exemple, in some tuts, they call the DescribePixelFormat, and in some other tuts, they don’t call it… naturally, that excites my curiosity, then i would like to get a simple doc where the functions are listed and described briefly.

Thanks for your reply, i’ll dig in nvidia’s site, but could u give me the name of the document i have to look for please ? or maybe a link ?

There is complete on-line documentation on this site, on the main page you can do a search for any Opengl function.

If you have not noticed there are lot’s of book’s on Opengl programming.

Also book’s on-line, the openGL reb book is a good source on command usage.

Red book

Originally posted by charly:
[b]Hi,
i’m new to opengl programing and i am having troubles to simply find the documentation for it.

I have already made a few things with DirectX, and i wondered if there was a documentation similar to the one given with the DirectX sdk (this document contains the description of the DirectX functions, notes from authors, …, and i would need the same for opengl)[/b]

[This message has been edited by nexusone (edited 02-06-2002).]

[This message has been edited by nexusone (edited 02-06-2002).]

Thanks for your help.

Visual C++ has full context sensative help
for all GL and GLU functions. Just type a function name, highlight it and hit F1.

Hmmm, one more thing,
i got it working a little bit now and i identified the source of the problem.
When i don’t set up the projection and model matrices it seems to work. (i draw in 2D now)

Here is my code initializing the matrices :
//create a perspective projection
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();

gluPerspective (45.0f, (GLfloat) m_dwWidth / (GLfloat) m_dwHeight, 1.0f, 100.0f);

//switch to our model matrix stack
glMatrixMode (GL_MODELVIEW);
glLoadIdentity ();

Do you see something wrong in it ?

PS: i should still be able to draw in 2D even after having set up these matrices no ?

If you’re drawing 2D you should set up an orthographic projection and not a perspective one:

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
now either
gluOrtho2D(…)
or
glOrtho(…)

-Lev

Sure, if i WANTED to draw 2D, actually, i draw 2D to try to make my code work.

I use the glVertex2i function to do so, and i feel like it draws on the screen plane, right ? (these are pre-transformed vertices who dont store homogeneous information, they are considered as already transformed (their range is of course [-1,1]))

If yes, it should be independent of the matrices, and should be directly shaded/drawn on the buffer, i guess.

If no, then it is normal that i have a diferent result when using this function after having set up the matrices or not…

I hope i am understandable.

The result does depends on how you set up your matrices, thats what matrices are for.

-Lev

I use the glVertex2i function to do so, and i feel like it draws on the screen plane, right ? (these are pre-transformed vertices who dont store homogeneous information, they are considered as already transformed (their range is of course [-1,1]))

glVertex2i(x, y) is EXACTLY the same as calling glVertex4i(x, y, 0, 1). It has nothing to do with pre transformed coordinates, non homogenous coordinates, window coordinates, or anything like that. They are transformed like any other vertex, in exactly the same way. The 2-parameter vertex commands adds two components (z=0 and w=1), and the 3-parameter commands adds one (w=1). In the end, you are always specifying a four-component vertex, either directly, or by letting OpenGL add the missing components.

I figured out what the glVertex2i function does during the night, and it is not at all what i thought it did.

Anyway, now i set up my matrices correctly everything goes fine.

OpenGL seems to be very powerfull by it’s simple approach, i prefer that type of approach than the DirectX’s one which hides everything behind complex stuff.
Why do most of the people in the game industry use DirectX ?

Thanks for your help.

Originally posted by charly:
Why do most of the people in the game industry use DirectX ?

The usual… DirectX is M$'s prefered way of doing things, and they tend to get what they want. They could just as well have gone for OpenGL years ago, but then they would not have 100% control over things. (Ooops - carried away again - hope this does not turn into another OpenGL/DirectX war).