if (name.endsWith(".tga")) {
imageLoader = new TGAImageData();
} else {
imageLoader = new ImageIOImageData();
}
ByteBuffer imageData = imageLoader.loadImage(ResourceLoader.getResourceAsStream(name));
imageData.rewind();
width = imageLoader.getWidth();
height = imageLoader.getHeight();
textureWidth = imageLoader.getTexWidth();
textureHeight = imageLoader.getTexHeight();