Load a PNG file with pure OpenGL
问题 I am trying to make a simple game in Java. I want to know how I can read a PNG file and use it in the game using only the OpenGL library. Can anyone provide any code that could accomplish this? 回答1: You can't load a texture directly using a single API call. You can however load a BufferedImage through ImageIO, and then convert it to an OpenGL texture. Example source code can be found here TextureLoader 回答2: You can't load images only using OpenGL. You should always keep in mind that OpenGL is