title: Combining vertex arrays with textures in OpenGL
body: <p>I'm trying to use vertex arrays to draw a reasonably large mesh, containing a large number of vertices. The textures have been determined from these and it's easy enough to draw in immediate mode along the lines of:</p>
  
  <pre><code>glBegin(GL_TRIANGLES) {
    for ( int faceIdx = 0; faceIdx &lt; nFaces; ++faceIdx )
       glVertex3fv(&amp;vertexArray[vIdx]);
       glTexCoord2fv(&amp;texCoord[vIdx++]);
       glVertex3fv(&amp;vertexArray[vIdx]);
       glTexCoord2fv(&amp;texCoord[vIdx++]);      
       glVertex3fv(&amp;vertexArray[vIdx]);
       glTexCoord2fv(&amp;texCoord[vIdx++]);  
    }   
  } 
  glEnd();
  </code></pre>
  
  <p>However for readability, speed and the rest I want to use vertex arrays (with a view to moving to VBOs). Is there a way of getting around putting a single vertex into the array multiple times?</p>
  
  <p>As I understand it at the moment it's necessary to specify each vertex of the mesh as many times as it appears in a face of the mesh, as each vertex identifies to multiple texture coordinates (the textures are captured from a real-world image of the object the mesh approximates), i.e. my vertex/tex coord array reads as if I'd filled it in immediate mode.</p>
  
  <p>Is there any way to use vertex arrays, whilst specifying the texture coordinates, without using redundant (by which I mean repeated) vertices?</p>