Hello everyone,
I have having issues understanding the opengl index buffers. Here is what I have, a simple quad...
GLfloat verts[] = { 1.0f , 1.0f , 1.0f , //[ 0 ]
-1.0f , 1.0f , 1.0f , //[ 1 ]
-1.0f , -1.0f , 1.0f , //[ 2 ]
1.0f , -1.0f , 1.0f }; //[ 3 ]
GLushort indices[] = { 0 , 1 , 2 ,
2 , 1 , 3};
GLfloat uv[] = { 1.0f , 1.0f , //front face
0.0f , 1.0f ,
1.0f , 0.0f ,
1.0f , 0.0f ,
0.0f , 1.0f ,
0.0f , 0.0f
};
Bound, filled, and passed into my shaders with a texture.
However, when I make the call
glBindBuffer( GL_ELEMENT_ARRAY_BUFFER , index_id );
glDrawElements( GL_TRIANGLES , 3 * 2 , GL_UNSIGNED_SHORT , (void*) NULL );
The textures uv co-ordinates are all screwed up. My winding is CCW for both the verts and the indices. Every index has a uv coordinate so I am at a loss.
Mike