
166 5. OpenGL ES: Turbocharged!
glVertexPointer (GLint size, GLenum type, GLsizei stride,
const GLvoid *pointer). e rst parameter species how many compo-
nents a vertex possesses. (is is not at once clear from the array, so we need to
specify it explicitly.) Possible values are 2, 3, and 4. en you give the data type
of the elements. OpenGL supplies a suitable constant for each data type. Since
wehave declared the array as GLshort, we choose the constant GL_SHORT. You
probably know that a data type determines how much space an element occupies
in memory. Sothat OpenGL can iterate through all the elements of an array, we
must specify how ...