glTexGen

How do I use this, and what is it usually used for?

You use it by enabling it in the appropriate texture dimensions.

i.e. glEnable(GL_TEXTURE_GEN_?);

where ? is S, T or R.

Enable S and T for sphere mapping. Enable R as well for cube mapping.

The method that S, T, and R will use to determine how the texture coords are generated is specified by glTexGeni(GL_?, GL_TEXTURE_GEN_MODE, GL_X);

Where GL_? is GL_S, GL_T, and GL_R, and GL_X, is one of GL_SPHERE_MAP, GL_EYE_LINEAR, GL_OBJECT_LINEAR, or GL_REFLECTION_MAP (cube mapping)

check out my website… for some example code of using this.
www.nutty.org

Nutty