I am having the same problem that dsellars had on antoher thread. I have png’s that have black background. I have set black as my clear color and the backgrounds are completely gone (what I want) but the image is transparent.
I am using the testure loader form LWJGL examples with the following line:
BufferedImage tex = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_4BYTE_ABGR);
Anything other that that type_4byte_abgr or type_3byte_bgr will cause the following line to error out with a clas cast exception at the following line:
byte data[] = (byte[]) tex.getRaster().getDataElements(0, 0, tex.getWidth(), tex.getHeight(), null);
my code for transparency is as follows and i have tried with with and without the commented code:
if(isTransparent()) {
GL11.glEnable(GL11.GL_BLEND); // Set up blending for transparency
//GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE); // Blending Function For Translucency Based On Source Alpha Value
//GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
//GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_REPLACE);
}
regardless of changes, to have solid images, I must have solid backgrounds.
where is my clubieness at its highest?
M
EDIT: one note…if I use Fireworks and use a transparent canvas and use GL11.GL_ONE_MINUS_SRC_ALPHA it does what it should, but is this best practice?
