I tried the following code, thinking it would give me a translucent blue rectangle overlapping a red rectangle - but the blue rectangle is also opaque - am I doing something wrong?
I tried specifying 8 alpha bits in the AWTGLCanvas constructor, but no luck…
GL11.glColor4f(0, 0, 1, 1f);
GL11.glBegin(GL11.GL_QUADS);
{
GL11.glVertex2f(10, 10);
GL11.glVertex2f(10, 30);
GL11.glVertex2f(30, 30);
GL11.glVertex2f(30,10);
}
GL11.glEnd();
GL11.glColor4f(1, 0, 0, 0.1f);
GL11.glBegin(GL11.GL_QUADS);
{
GL11.glVertex2f(15, 20);
GL11.glVertex2f(15, 40);
GL11.glVertex2f(25, 40);
GL11.glVertex2f(25,20);
}
GL11.glEnd();
