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:
1
| 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:
1
| 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:
1 2 3 4 5 6 7
| if(isTransparent()) { GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE); } |
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?