I was one of the original authors of that class. The TextureIO stuff will try to leverage the GL_ARB_texture_rectangle and GL_ARB_texture_non_power_of_two extensions whenever possible. If neither are available, it will just stick the non-pow2 image in a pow2 texture (without any special scaling), and then the texcoords will be calculated appropriately and returned via the convenience methods. The only issues with these approaches (AFAIK) is in the area of texture wrap modes. If we use the GL_TEXTURE_RECTANGLE_ARB codepath, then certain wrap modes are not legal:
http://oss.sgi.com/projects/ogl-sample/registry/ARB/texture_rectangle.txt
Note that these restrictions do not apply to the non-pow2 codepath, or in the default pow2 codepath. However, in the default pow2 codepath, if you rely on any of the wrap modes in your application (e.g. GL_REPEAT, GL_CLAMP_TO_EDGE) then wrapping may not work as you might expect (esp. when your image does not extend to the edges of the pow2 texture). There are probably ways to deal with this in the TextureIO implementation, but they’re all hacky (we have to resort to some of this in the OGL pipeline for Java 2D).
So anyway, the REMIND comment was referring to these issues. I think the easiest way to resolve it is to clearly document these issues (i.e. if you rely on texture wrapping modes, then be sure to specify a pow2 image, unless you can be sure that the GL_ARB_texture_non_power_of_two extension is available).
This was another thing that should be added to the docs somewhere. OpenGL developers often aren’t aware that the image data (and things like glColor()) they typically deal with is non-premultiplied, meaning the alpha component hasn’t been applied to the color components. However, the typical Porter-Duff blending rules require that both the source and destination components are premultiplied. 99% of the time OpenGL developers just want “source over” mode, and all the tutorials will tell you to use glBlendFunc(GL_SRC, GL_ONE_MINUS_SRC_ALPHA), which is a clever way to get “source over” blending (with the components premultiplied as part of the blending step, but it’s not strictly the same as the way P-D define it).
Anyway, it’s much easier to do all blending in OpenGL if you’re dealing with premultiplied components, so when I was working on the TextureIO stuff I made sure that translucent images are premultiplied before storing them in the texture. This probably makes sense to those familiar with Java 2D’s “_PRE” formats, but might not be obvious to OpenGL developers, thus the comment.
It would be great if someone could boil this down into the javadocs for the TextureIO stuff (I’m too busy with Java 2D stuff at the moment).
Thanks,
Chris