Hi. Say, for your 2d OpenGL game (which will be finished by 2010 or so) you’ve to load many 2d textures, stored as compressed PNGs on disc/Jar/whatever. This even applies to a single level, so you’re very keen to use the fastest way to feed these PNGs to your OpenGL card. Which is a really fast way?
Currently I load them via ImageIO to a BufferedImage whose raster.getDataBuffer() I feed to the Ogl texture bind call o.glTexImage2D(…).
However, this takes a long time.
Maybe I could cache those PNGs when they’ve been uncompressed for the first time and write them to plain files (into a cache folder) and then at the next run the game would load them via (mapped) “new I/O” or such?
However, maybe loading large uncompressed files from disc takes even longer than loading smaller compressed ones plus their cpu time needed to uncompress them…?