Hey people,

Im having trouble getting my textures to display right.

The square in the top left is the image i am using, and as you can see, the images are coming out wrong.

The output of my program as far as i can see is in the correct format..

Index: 1 tX: 0 tY: 0 Index: 2 tX: 1 tY: 0 Index: 11 tX: 1 tY: 1 Index: 1 tX: 0 tY: 0 Index: 11 tX: 1 tY: 1 Index: 10 tX: 0 tY: 1 Index: 3 tX: 0 tY: 0 Index: 4 tX: 1 tY: 0 Index: 13 tX: 1 tY: 1 Index: 3 tX: 0 tY: 0 Index: 13 tX: 1 tY: 1 Index: 12 tX: 0 tY: 1 Index: 5 tX: 0 tY: 0 Index: 6 tX: 1 tY: 0 Index: 15 tX: 1 tY: 1 Index: 5 tX: 0 tY: 0 Index: 15 tX: 1 tY: 1 Index: 14 tX: 0 tY: 1 Index: 7 tX: 0 tY: 0 Index: 8 tX: 1 tY: 0 Index: 17 tX: 1 tY: 1

This is my code for displaying the images.

glEnableClientState( GL_VERTEX_ARRAY ); glEnableClientState( GL_TEXTURE_COORD_ARRAY ); glVertexPointer( 3, GL_FLOAT, 0, m_vertices ); glTexCoordPointer( 2, GL_FLOAT, 0, texCoords ); glBindTexture(GL_TEXTURE_2D, m_textureOne ); glDrawElements( GL_TRIANGLES, m_ammountPoints, GL_UNSIGNED_INT, m_squareLight ); glDisableClientState( GL_VERTEX_ARRAY ); glDisableClientState( GL_TEXTURE_COORD_ARRAY );

Any ideas what could be going wrong ? - as far as i can tell, the indices seem to line up with the texcoords.. But everysqure seems to be different ?