title: OpenGL Texture transparency doesn't work
body: <p>I'm having an OpenGL texture that is binded to a simple quad.</p>
  
  <p>My problem is: My texture is 128x128 pixels image. I'm only filling up about 100x60 pixels on that image, the other pixels are transparent. I saved it in a .png file. When I'm drawing, the transparent part of the binded texture is white.</p>
  
  <p>Let's say I have a background. When I draw this new quad on this background I can't see the through the transparent part of my texture.</p>
  
  <p>Any suggestions?</p>
  
  <p>Code:</p>
  
  <pre><code>// Init code...
  gl.glEnable(gl.GL_TEXTURE_2D);
  gl.glDisable(gl.GL_DITHER);
  gl.glDisable(gl.GL_LIGHTING);   
  gl.glDisable(gl.GL_DEPTH_TEST);
  
  gl.glTexEnvi(gl.GL_TEXTURE_ENV, gl.GL_TEXTURE_ENV_MODE, gl.GL_MODULATE); 
  
  // Drawing code...
  gl.glBegin(gl.GL_QUADS);
  gl.glTexCoord2d(0.0, 0.0);
  gl.glVertex3f(0.0f, 0.0f, 0.0f);
  gl.glTexCoord2d(1.0, 0.0);
  gl.glVertex3f(1.0f, 0.0f, 0.0f);
  gl.glTexCoord2d(1.0, 1.0);
  gl.glVertex3f(1.0f, 1.0f, 0.0f);
  gl.glTexCoord2d(0.0, 1.0);
  gl.glVertex3f(0.0f, 1.0f, 0.0f);
  gl.glEnd();
  </code></pre>
  
  <p>I've tried almost everything, from enabling blending to change to GL_REPLACE, however I can't get it to work.</p>
  
  <p>Edit:</p>
  
  <pre><code>// Texture. Have tested both gl.GL_RGBA and gl.GL_RGB8.
  gl.glTexImage2D(gl.GL_TEXTURE_2D, 0, (int)gl.GL_RGBA, imgWidth, imgHeight,
              0, gl.GL_BGR_EXT, gl.GL_UNSIGNED_BYTE, bitmapdata.Scan0);
  </code></pre>