}
if (pngStream == null) {
throw new IOException("Missing png to go with texture json");
}
try {
PNGDecoder decoder = new PNGDecoder(pngStream);
ByteBuffer buf = ByteBuffer.allocateDirect(4 * decoder.getWidth() * decoder.getHeight());
decoder.decode(buf, decoder.getWidth() * 4, PNGDecoder.RGBA);
buf.flip();
ByteBuffer data = buf;
int height = decoder.getHeight();
int width = decoder.getWidth();
Texture.FilterMode filterMode = Texture.FilterMode.NEAREST;
Texture.WrapMode wrapMode = Texture.WrapMode.CLAMP;
Texture.Type type = Texture.Type.TEXTURE2D;