Does anyone know how to enable blending in OpenGL (android) on HTC Desire. I am trying to draw colored triangles and use the alpha value of the color buffer to blend them with the background (or another triangle).
It works both on emulator (2.1) and on htc hero 2.1, but not on my desire since 2.2. Is there a difference in equipment between the hero and the desire that causes this?
The main material from the code (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,
1f, 0f, 0f, 0.5f,
1f, 0f, 0f, 0.5f,
1f, 0f, 0f, 0.5f,
1f, 0f, 0f, 0.5f,
1f, 0f, 0f, 0.5f,
1f, 0f, 0f, 0.5f,
1f, 0f, 0f, 0.5f,
};
PS. I can provide more code if someone needs it ...