is this the correct way to use glTexCoordPointer?
- by RubyKing
Hey all Just trying to work out how to use this function glTexCoordPointer.
Here is the man pages http://www.opengl.org/sdk/docs/man/xhtml/glTexCoordPointer.xml which 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? like this
glTexCoordPointer(1, GL_FLOAT, 6, reinterpret_cast(29 * sizeof(float)) );
for the fifth element on the 2nd quad first row.
any help is thankful