Skip to main content

Posts

Showing posts with the label apng

Loading an animated image to a BufferedImage array

I'm trying to implement animated textures into an OpenGL game seamlessly. I made a generic ImageDecoder class to translate any BufferedImage into a ByteBuffer. It works perfectly for now, though it doesn't load animated images. I'm not trying to load an animated image as an ImageIcon. I need the BufferedImage to get an OpenGL-compliant ByteBuffer. How can I load every frames as a BufferedImage array in an animated image ? On a similar note, how can I get the animation rate / period ? Does Java handle APNG ?