title: iPhone OpenGL ES incorrect alpha blending
body: <p>I have a problem with incorrect alpha blending results with openGL ES on iPhone.</p>
  
  <p>This is my code for creating texture object:</p>
  
  <pre><code>glGenTextures(1, &amp;tex_name);
  glBindTexture(GL_TEXTURE_2D, tex_name);
  glTextImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex_width, tex_height, GL_RGBA, GL_UNSIGNED_BYTE, tex_data);
  </code></pre>
  
  <p>'tex_data' is loaded from raw RGBA8888 data packed with zlib. It loads as it should, wich i've checked with a debugger.</p>
  
  <p>This is my code for setting up texture before rendering:</p>
  
  <pre><code>glEnable(GL_BLEND);
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  
  glBindTexture(GL_TEXTURE_2D, tex_name);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
  </code></pre>
  
  <p>I've uploaded a sample of what I've expected and what I've got here: <a href="http://img43.imageshack.us/gal.php?g=alphablendgood.png" rel="nofollow noreferrer">sample</a> . In the sample most of the texture in the bottom is pitch-black with 70% opacity. However openGL renders it as gray. This problem affects all of my textures I use blend with.</p>
  
  <p>I've tested the code on windows with use of OGLES PVRVFrame and the results are as expected: black is rendered as black.</p>