问题
I'm using Slick Util's Texture class to load textures for lwjgl, but apparently that forces your texture to a power of 2.
How would you use a texture that's not a power of 2? (I really don't want to add transparent pixels to the edge of the image to make it a power of 2.)
I've seen somewhere that it's possible, but I can't find any way of doing it.
回答1:
The reason the stick-utils package forces you to use power-of-two textures is this is what graphics cards like to load. Where possible, you should pack all your images in to a large power-of-two texture and draw from that instead of loading all the textures separately.
So whilst it's not impossible, there is a reason it is made hard.
来源:https://stackoverflow.com/questions/9543093/how-do-you-use-not-power-of-2-textures-in-lwjgl