Legacy (immediate mode)family
glVertex*
The old immediate-mode calls that sent one vertex at a time between glBegin and glEnd.
Removed from the core profile. Immediate mode, removed from the core profile in OpenGL 3.2.
Signature
void glVertex{2|3|4}{f|d|i|s}[v](…);
How it works
Old tutorials are full of glVertex3f, glColor3f and glNormal3f inside glBegin/glEnd. Every call crossed from the CPU to the driver, which is why a mesh of a million vertices was slow. In modern OpenGL vertices live in a buffer on the GPU, are described by glVertexAttribPointer, and are drawn with one glDrawArrays.
Reading the name
- 2 3 4
- Coordinates given: x y; x y z; x y z w.
- f d i s
- float, double, int, short.
Functions in this family
Example
example.cpp
1glBegin(GL_TRIANGLES);
2 glVertex3f(-0.5f, -0.5f, 0.0f);
3 glVertex3f( 0.5f, -0.5f, 0.0f);
4 glVertex3f( 0.0f, 0.5f, 0.0f);
5glEnd();