title: Computing texture coordinates for a single tile with a texture atlas in OpenGL
body: <p>I'm trying to use a texture atlas in a game program I'm writing in C#/OpenGl with the OpenTK library.</p>
  
  <p>I loaded my texture atlas as a texture in OpenGL (dimension is 256x256) and each tile is 32x32.</p>
  
  <p>To get the first tile of the atlas to display, I used this code:</p>
  
  <pre><code>GL.Begin(BeginMode.Quads);
  GL.TexCoord2(0, 0); GL.Vertex2(0, 0);
  GL.TexCoord2(0.125f, 0); GL.Vertex2((32 * zoom), 0);
  GL.TexCoord2(0.125f, 0.125f); GL.Vertex2((32 * zoom), (32 * zoom));
  GL.TexCoord2(0, 0.125f); GL.Vertex2(0, (32 * zoom));
  GL.End();
  </code></pre>
  
  <p>0.125 was computed by dividing 1/8, 8 being the number of tiles in a row/column.</p>
  
  <p>I've got no idea how to compute the second tile's coordinates this way!
  I tried using 0.125 and 0.25 in place of 0 and 0.125 respectively, but this renders nothing. I'm guessing you aren't allowed to use a value greater than zero for (EDIT)the first (0) texture coordinates?</p>
  
  <p>If anyone could help or provide a better way of doing this, it would be much appreciated!</p>