boolean genMipmap) throws IOException {
//TODO: npot check
InputStream input = null;
try {
input = pngRef.openStream();
PNGDecoder dec = new PNGDecoder(input);
width = dec.getWidth();
height = dec.getHeight();
ByteBuffer buf = BufferUtils.createByteBuffer(4 * width * height);
dec.decode(buf, width * 4, PNGDecoder.Format.RGBA);
buf.flip();
glEnable(getTarget());
id = glGenTextures();