I'm having a problem for displaying a single quad, here is how i do :


//note: this code is only for 2 triangles, while on picture there is 4 triangles
float tex_coord[] =
{
0.0, 0.0, //3
0.0, 1.0, //2
1.0, 1.0, //0
1.0, 1.0, //0
1.0, 0.0, //1
0.0, 0.0
}; //how many coords should i give3
}; ?
int indexes[] =
{
3, 2, 0, 0, 1, 3
}
float vertexes[] =
{
-37, 0, 30,
-38, 0, 29,
-41, 0, 32,
-42, 0, 31
}
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, vertexes);
glTexCoordPointer(2, GL_FLOAT, 0, tex_coord);
glDrawElements(GL_TRIANGLES, 2, GL_UNSIGNED_INT, indices);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
The result :


I try to put 4x4 pairs of (u,v) coords (thus 16 in total), hoping it will work like in first situation (only one "row" of triangles) :
Here is what i give :
(0,0)
(0,1) (x 4)
(1,1)
(1,0)
But it didn't worked.

