glGenerateMipmap needs to come after glTexImage2D

Plus post_generate_mipmap made no sense otherwise...