What is the correct way to use glTexCoordPointer?
- by RubyKing
I'm trying to work out how to use this function glTexCoordPointer.
The man page states that I must set a pointer to the first element of the array that uses the texture cordinate.
Here is my array:
static const GLfloat GUIVertices[] = {
//FIRST QUAD
1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f,
-1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f,
-1.0f, 0.94f, 0.0f, 1.0f, 0.0f, 1.0f,
1.0f, 0.94f, 0.0f, 1.0f, 1.0f, 1.0f,
//2ND QUAD
// x y z w X Y
1.0f, -1.0f, 0.0f, 1.0f, 1.0f, 0.0f,
-1.0f, -1.0f, 0.0f, 1.0f, 0.0f, 0.0f,
-1.0f, -0.94f, 0.0f, 1.0f, 0.0f, 1.0f,
1.0f, -0.94f, 0.0f, 1.0f, 1.0f, 1.0,
};
But how do I set the pointer correctly for the fifth element on the 2nd quad first row? I was thinking something like this:
glTexCoordPointer(1, GL_FLOAT, 6, reinterpret_cast<const GLvoid *>(29 * sizeof(float)));