So I know in order for a texture to be complete, it needs a mipmap defined. Or so I know.
To load PNG files, I use TWL class.
public static TextureData loadTexture(String location) throws IOException {
final int tid = glGenTextures();
final FileInputStream fis = new FileInputStream(location);
final PNGDecoder decoder = new PNGDecoder(fis);
final int width = decoder.getWidth(), height = decoder.getHeight();
final ByteBuffer bb = BufferUtils.createByteBuffer(width * height * 4);
decoder.decode(bb, decoder.getWidth() * 4, PNGDecoder.Format.RGBA);
bb.flip();
fis.close();
glBindTexture(GL_TEXTURE_2D, tid);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
//TODO: Add min and max mipmap stuff for finished texture
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, bb);
glBindTexture(GL_TEXTURE_2D, 0);
final TextureData t = new TextureData(tid, location, width, height);
Textures.add(t);
return t;
}
I am not asking for code, but I am asking for code. What do I put at the //TODO: to make this a complete texture?
Alongside of that, the original intent of this post was to ask why make a complete texture and is it necessary or beneficial.