Does anyone know how to enable blending in OpenGL (android) on a HTC Desire. I am trying to draw colored triangles and using the alpha value of the color buffer to blend them with the background (or another triangle).
It works both on the emulator (2.1) and on a htc hero 2.1 but not on my desire with 2.2. Is there some hardware difference between a hero and a desire that causes this?
The main stuff from the code is (not in order):
gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
gl.glEnable(GL10.GL_BLEND);
gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
private final static float[] colors = {
1f, 0f, 0f, 0.5f, // point 0 red
1f, 0f, 0f, 0.5f, // point 1 red
1f, 0f, 0f, 0.5f, // point 2 red
1f, 0f, 0f, 0.5f, // point 3 red
1f, 0f, 0f, 0.5f, // point 4 red
1f, 0f, 0f, 0.5f, // point 5 red
1f, 0f, 0f, 0.5f, // point 6 red
1f, 0f, 0f, 0.5f, // point 7 red
};
PS. I can provide more code if someone needs it...