title: How are `glTexEnv`, `glColor4x` and `glBlendFunc` related in OpenGL ES 1.0?
body: <p>I'm looking at SurfaceFlinger, i.e. the the code that is doing the composition in Android, and I have trouble understanding some of the OpenGL ES 1.0 calls as I've only programmed ES 2.0 code.</p>
  
  <p>Here goes the piece of code that interests me:</p>
  
  <pre><code>glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
  glColor4x(0x10000, 0x10000, 0x10000, 0x10000);
  glEnable(GL_BLEND);
  glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
  </code></pre>
  
  <p>What it is supposed to be doing is blending a texture into the buffer.</p>
  
  <p>Why does one need the <code>glTextEnvx</code> and <code>glColor4x</code> calls? Isn't <code>glBlendFunc</code> enough for achieving blending?</p>
  
  <p>I <em>know</em> my question is naive, but I still don't understand what is <code>glTexEnvx</code> for even after reading the <a href="http://www.khronos.org/opengles/documentation/opengles1_0/html/glTexEnv.html" rel="noreferrer">docs</a>.</p>