title: Android OpenGL ES zooming using glDrawTexfOES possible?
body: <p>I've got a few textures drawn using <code>glDrawTexfOES</code> which display fine. I want to be able to change the camera view to give the impression of zooming in or out, but that's where I'm having trouble. I tried making basic vertex arrays and this worked correctly and I could zoom. However, I want to be able to zoom textures using <code>glDrawTexfOES</code>. The relevant code is below:</p>
  
  <p><code>onSurfaceCreated</code> includes calls to:</p>
  
  <pre><code>gl.glEnable(GL10.GL_TEXTURE_2D);            
  gl.glShadeModel(GL10.GL_SMOOTH);        
  gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f);    
  gl.glClearDepthf(1.0f);                 
  gl.glEnable(GL10.GL_BLEND);
  gl.glBlendFunc(GL10.GL_ONE, GL10.GL_ONE_MINUS_SRC_ALPHA);
  gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
  gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
  </code></pre>
  
  <p><code>onSurfaceChanged</code> full implementation (I suspect the issue lies here)</p>
  
  <pre><code>public void onSurfaceChanged(GL10 gl, int width, int height) {
      mWidth = width;
      mHeight = height;
      gl.glViewport(0, 0, mWidth, mHeight);   
      gl.glMatrixMode(GL10.GL_PROJECTION);    
      gl.glLoadIdentity();    
      gl.glOrthof(0, mWidth, 0, mHeight, -1, 1);
      gl.glMatrixMode(GL10.GL_MODELVIEW); 
      gl.glLoadIdentity();                
  }
  </code></pre>
  
  <p>And finally, the onDrawFrame implementation:</p>
  
  <pre><code>public void onDrawFrame(GL10 gl) {
      gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    
      gl.glLoadIdentity();
      // Set crop area (UVarray are uv co-ords for a texture map, the texture renders fine.)
  ((GL11) gl).glTexParameterfv(GL10.GL_TEXTURE_2D, GL11Ext.GL_TEXTURE_CROP_RECT_OES,UVarray,0);
  // Draw texture
  ((GL11Ext) gl).glDrawTexfOES(32.0f,32.0f,0.0f,64.0f,64.0f); 
  }
  </code></pre>
  
  <p>I have tried changing the parameters of <code>glViewport</code> and <code>glOrthof</code> to width*2 and height*2 but the textures still do not scale at all, they remain exactly the same. When I swap to using vertex arrays, these adjustments work. </p>
  
  <p>Any help would be greatly appreciated.</p>