glBlendFunc cross platform issue
in
Contributed Library Questions
•
2 years ago
I am encountering a strange cross-platform issue while using glBlendFunc. I developed this on Windows XP but it will ultimately be running in installation on a MacBook pro. My contact person at the installation site has been testing the software and has noticed a very strange blending problem that doesn't occur on my computer. I have included a comparison screenshot of the issue, with the left side captured on Windows XP and the right side captured on the Mac.
As you can see, the blending works well in Windows, but on the Mac the textures appear to have their transparent areas saturated black. I am using gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_DST_ALPHA); to accomplish this type of blend. I am using GLGraphics as the renderer. The texture is being rendered as a Texture object like so:
- // draw indicator
- gl.glPushMatrix();
- gl.glTranslatef(x, y, 0);
- gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_DST_ALPHA);
- gl.glColor4f(r, g, b, a);
- texture.bind();
- texture.enable();
- gl.glBegin(GL.GL_QUADS);
- gl.glTexCoord2f(0, 0);
- gl.glVertex2f(-diameter/2, -diameter/2);
- gl.glTexCoord2f(1, 0);
- gl.glVertex2f(diameter/2, -diameter/2);
- gl.glTexCoord2f(1, 1);
- gl.glVertex2f(diameter/2, diameter/2);
- gl.glTexCoord2f(0, 1);
- gl.glVertex2f(-diameter/2, diameter/2);
- gl.glEnd();
- texture.disable();
- gl.glPopMatrix();
My machine is running Windows XP 64-bit with a GeForce 9800GT. The mac is running
Snow leopard 10.6.8, has an I
ntel core i7 2.2ghz, and
AMD Radeon HD 6750m and Intel HD Graphics 3000. I unfortunately don't have a mac of my own to test different blend options on to see what will work, so I am relying on hopefully somebody having encountered a similar cross-platform issue before.
1