gluBuild2DMipmaps?

In the docs for gluBuild2DMipmaps, it says:


int gluBuild2DMipmaps(
  GLenum target,
  GLint components,
  GLint width,
  GLint height,
  GLenum format,
  GLenum type,
  const void *data
);

components 
The number of color components in the texture. Must be 1, 2, 3, or 4. 

However, I see some OpenGL examples using internalformat, such as GL_RGB8, for the components argument instead.
The internalformat argument belongs to glTexImage2D():


void glTexImage2D(
  GLenum target,
  GLint level,
  GLint internalformat,
  GLsizei width,
  GLsizei height,
  GLint border,
  GLenum format,
  GLenum type,
  const GLvoid *pixels
);

Just wondering if the docs for gluBuild2DMipmaps are wrong, out-dated, or incomplete.

Yes, components IS internalformat however gluBuild2DMipmaps is not necessary anymore. Let the hw handle it with

glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);

See
http://www.opengl.org/wiki/index.php/Texture_Mapping

Thanks! That looks much better. No confusing arguments. I suppose if I wanted to “turn off” mip-mapping for a texture that
was already created using this method, I could just set GL_TRUE to GL_FALSE and call it again?

Or perhaps I have to delete the textureID to get rid of the mimaps?

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR OR GL_NEAREST) turns off.

What I mean is, calling GL_GENERATE_MIPMAP with GL_TRUE allocates texture memory for mipmapping.

I’m assuming calling GL_GENERATE_MIPMAP with GL_FALSE de-allocates this mipmap texture memory, rather than
just “suspending” its use.

The specification doesn’t say, so it is implementation dependent.
See page 178 “Automatic Mipmap Generation” (or 192 shown in Adobe Reader)