I have this code from the LWJGL examples:
public Texture loadImage(String filename) throws Exception {
Texture texture = null;
BufferedImage tmpImg = null;
/* normally I would use StringUtils.isValid(String) from the
jakarta commons lib, but thats beyond the scope of this lesson */
if ((filename != null) && (filename.trim() != "")) {
try {
InputStream is = getClass().getResourceAsStream(filename);
tmpImg = (BufferedImage) ImageIO.read(is);
if (tmpImg == null) {
throw new Exception("Error: Got null from ImageIO.read()");
}
texture = new Texture(tmpImg);
}
catch ( Exception e ) {
throw new Exception("Problem loading bitmap", e);
}
} else {
throw new Exception("Error: file name is not valid!");
}
return texture;
}
And it has problems finding bmps, but not pngs. Is there a reason for this? And what settings do I need on the png for it to show up?
Thanks.