Why use the "f" suffix?

Hi everyone,
i’m a newbie in OpenGL, and i’m asking some question:
for example in this line:

glFogf(GL_FOG_DENSITY, 0.05f);

What does the “f” suffix stands for?

Another question:


What does glMatrixMode and glLoadIdentity mean?

Thanks in advance :smiley:

f stands for float, verses d stands for double etc.
There are four stacks of matrices: projection, modelview, texture and color.
Before you call glLoadIdentity to set the values of a matrix, you need to specify which matrix stack you want to set. So you call glMatrixMode() to set the “current” matrix.
In your 2 lines of code, glLoadIdentity() will set the value of projection matrix as identity matrix.

[QUOTE=Coconut;1242470]f stands for float, verses d stands for double etc.

Thank you!

OK. What is matrices? :slight_smile:
last question: glVertex sets a point of a polygon?

Cheers. :smiley:

Up …

glVertex*() defines the position of a vertex which can either be rendered as a single point or can be a vertex in a sequence of vertices making up a more complex entity, like a line, a triangle, a quad or a more general polygon. The name of the function is a little misleading as it really defines the position in object-space, which is only one of potentially many so called vertex attributes a vertex may be associated with. Other vertex attributes may include a normal, a vertex color, a texture coordinate and so forth.

Note: glVertex*() is legacy OpenGL! Modern OpenGL uses different ways to specify geometry and vertex attributes. If you’re just now learning OpenGL, please learn modern OpenGL, i.e. OpenGL 3.0 or higher.