title: OpenGl ES - How to map different textures to a grid of tiles
body: <p>Just been learning some OpenGL on android learning the basics of making a game.</p>
  
  <p>The trouble I'm having is to do with mapping different textures "per tile" onto my grid.</p>
  
  <p>For instance:</p>
  
  <p>I have a grid of tiles - 8x8 - in my vertex array I define the grid by defining a 9x9 vertices to construct the columns/rows. I then go and make an index buffer telling it how to draw the 2 triangles that make up each square in the grid.</p>
  
  <p>My frustration lies in mapping textures to different tiles of the grid as each square SHARES vertices with other squares in the grid, and as far as I know you can only apply one texture coord per vertices in Opengl.</p>
  
  <p>The only solution I can think of is to generate duplicate vertices in the vertex buffer which would allow me to assign individual texture coordinates per vertex (even though the vertex would already be in the buffer from the generation of the previous tile). 
  This way would end me up with a whole heap of duplicate vertices which in my head doesnt seem right. I also want to avoid having to dynamically create a large bitmap and then map it onto the grid with fractional texture coords.</p>
  
  <p>Can someone please educate my novice mind on how I go about getting different textures per tile on a grid!</p>
  
  <p>Thanks!</p>