title: Android and glOrthof
body: <p>I am developing a simple tile world game for Android 2.3.  I am trying to set up an orthographic view in opengl but my 1x1 tiles show up oblong -- oriented to the direction of the screen -- if the screen is in vertical position then the square is stretched vertically, if horizontal then it is stretched horizontally.  Here is what I have in my onSurfaceChanged method:</p>
  
  <pre><code>gl.glViewport(0, 0, width, height);
  gl.glMatrixMode(GL10.GL_PROJECTION);
  gl.glLoadIdentity();
  gl.glOrthof(0.0f, width, 0.0f, height, 1.0f, 100.0f);
  </code></pre>
  
  <p>In my onDrawFrame method I have:</p>
  
  <pre><code>gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
  gl.glLoadIdentity();
  GLU.gluLookAt(gl, 
      0.0f, 0.0f, 6.0f, // eye translation 
      0.0f, 0.0f, 0.0f, // eye center
      0.0f, 1.0f, 0.0f  // eye world up
      ); 
  // draw objects
  </code></pre>
  
  <p>From the object onDraw method:</p>
  
  <pre><code>gl.glBindTexture(GL10.GL_TEXTURE_2D, mTextures[0]);
  gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
  gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
  gl.glVertexPointer(3, GL10.GL_FLOAT, 0, mFloatVertexBuffer);
  gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, mTexBuffer);
  gl.glEnable(GL10.GL_CULL_FACE);
  gl.glShadeModel(GL10.GL_SMOOTH);
  gl.glPushMatrix();
  gl.glTranslatef(localTranslation.getX(), localTranslation.getY(), localTranslation.getZ());
  gl.glScalef(localScale.getX(), localScale.getY(), localScale.getZ());
  gl.glRotatef(mAngle, localRotation.getX(), localRotation.getY(), localRotation.getZ());
  gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
  gl.glNormal3f(0.0f, 0.0f, -1.0f);
  gl.glPopMatrix();
  gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
  gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
  </code></pre>
  
  <p>I have used the same onSurfaceCreated, onDrawFrame, and onDraw methods with perspective mode and it worked without any distortion to the objects being drawn. I have tried a few different things pulled from the net (like replacing the right/bottom of the ortho call with width/height aspect ratio) but nothing seemed to correct the problem.  </p>
  
  <p>Here is what the screen looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/2IHAP.png" alt="The images should be perfect 1x1 squares in ortho mode."></p>
  
  <p>Any ideas?  What am I missing? All that I want to see are perfect 1x1 squares that I can throw textures on without distortion.</p>