So I've done that, and here's what I'm seeing. I'm trying to blit a solid square of transparency to a surface. My code looks something like this (it was extrapolated a bit to remove excess levels of abstraction):
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glColor4f(0f, 0f, 1f, 0f);
GL11.glBegin(GL11.QUADS);
{
GL11.glVertex2i(0, 0);
GL11.glVertex2i(0, 64);
GL11.glVertex2i(64, 64);
GL11.glVertex2i(64, 0);
}
GL11.glEnd();
GL11.glColor4f(0f, 0f, 0f, 1f);
GL11.glBegin(GL11.QUADS);
{
GL11.glVertex2i(8, 0);
GL11.glVertex2i(8, 24);
GL11.glVertex2i(24, 24);
GL11.glVertex2i(24, 0);
}
GL11.glEnd();
GL11.glColor4f(1f, 1f, 1f, 1f);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, mTextureID);
GL11.glCopyTexImage2D(GL11.GL_TEXTURE_2D,
0,
GL11.GL_RGBA,
0,
0,
64,
64,
0);
GL11.pushMatrix();
GL11.glBindTexture(GL11.GL_TEXTURE_2D, mTextureID);
GL11.glTranslatef((float)(Window.getWidth()/2 - 32), (float)(Window.getHeight()/2 - 32), 0f);
GL11.glBegin(GL11.GL_QUADS);
{
GL11.glTexCoord2f(0f, 0f);
GL11.glVertex2i(0, 0);
GL11.glTexCoord2f(0f, 1f);
GL11.glVertex2i(0, 64);
GL11.glTexCoord2f(1f, 1f);
GL11.glVertex2i(64, 64);
GL11.glTexCoord2f(1f, 0f);
GL11.glVertex2i(64, 0);
}
GL11.glEnd();
GL11.popMatrix();
What I'm seeing is just a solid blue square in the middle of the screen. What I was hoping to see was a blue square with a smaller square inside it that was the same color as my clear color. Am I doing something obviously wrong?
Paul