This has been a long time in coming, but a new texture loader/writer framework was recently checked in to the JOGL workspace. The TextureIO and related classes are joint work with Chris Campbell from the Java2D team at Sun with input from Romain Guy from the Swing team at Sun.
TextureIO makes it easy to read in textures from disk and use them with OpenGL. It is flexible enough to support loading of textures in a background thread where an OpenGL context is not current, and then feed the resulting TextureData to OpenGL in your main rendering thread. It has support for reading back textures from the graphics card, optionally in a compressed format like DXTn, and writing them to files. Support for DirectDraw surface (DDS), SGI RGB, Targa (TGA), and all ImageIO-supported formats (JPEG, PNG, etc.) is included. Non-power-of-two textures are supported either via the OpenGL 2.0 extension or ARB_texture_rectangle. The TextureIO framework is pure Java.
There are two new demos in the jogl-demos workspace in the demos.texture package which show how to use the new APIs. The first is a simple loader and viewer for textures, and the second is a command-line converter which automatically compresses to DXT3 if possible. All of the other JOGL demos have been updated to use the new APIs rather than the specific loaders. Along the way a couple of bugs have been fixed in the demos’ use of textures which were hidden up until now.
The second utility which has also been a long time in coming is a Screenshot utility class which makes it easy to take a snapshot of the frame buffer or a pbuffer. There currently aren’t any demos of this class but it is pretty straightforward to use – one line of code at the end of your display() method to take a snapshot and write it to disk. The Screenshot class contains the fast screenshot function to Targa files contributed by Carsten Weisse as well as two other routines which take the screenshot to a BufferedImage and which save it to an ImageIO-supported file format.
Javadoc for the new utilities can be found in the browsable javadoc on the JOGL home page. The TextureIO classes will probably be moved into their own subpackage in a future build.
Please try out the new APIs and post with any comments. Hopefully they will make it easier to write compelling applications with JOGL.