Legacy (immediate mode)GL 1.1
glVertexPointer
Described the fixed position array of old OpenGL; the ancestor of glVertexAttribPointer.
Removed from the core profile. Part of the legacy immediate mode, removed from the core profile in OpenGL 3.2. Shown here only so you can recognize it in old tutorials — use VBOs and VAOs instead.
Signature
void glVertexPointer(GLint size, GLenum type, GLsizei stride, const void *pointer);
How it works
The parameters are almost the same as glVertexAttribPointer's (size, type, stride, pointer), minus the location: there was only one position array. Often pointer was CPU memory, copied to the GPU on every draw, which is exactly the cost VBOs removed.
Parameters
sizeGLint
Coordinates per vertex: 2, 3 or 4.
typeGLenum
GL_FLOAT, GL_DOUBLE, GL_INT or GL_SHORT.
strideGLsizei
Bytes between vertices, 0 = packed.
pointerconst void *
CPU array, or an offset into a bound buffer.
Example
example.cpp
1glVertexPointer(3, GL_FLOAT, 0, positions);