MSDN Library


The gluBuild1DMipmaps function creates 1-D mipmaps.

int gluBuild1DMipmaps(
  GLenum target,
  GLint components,
  GLint width,
  GLenum format,
  GLenum type,
  const void *data


The target texture. Must be GL_TEXTURE_1D.
The number of color components in the texture. Must be 1, 2, 3, or 4.
The width of the texture image.
The format of the pixel data. The following values are valid: GL_COLOR_INDEX, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_BGR_EXT, GL_BGRA_EXT, GL_LUMINANCE, or GL_LUMINANCE_ALPHA.
The data type for data. The following values are valid: GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, or GL_FLOAT.
A pointer to the image data in memory.


The gluBuild1DMipmaps function obtains the input image and generates all mipmap images (using gluScaleImage) so that the input image can be used as a mipmapped texture image. The glTexImage1D function is then called to load each of the images. If the width of the input image is not a power of two, then the image is scaled to the nearest power of two before the mipmaps are generated.

A return value of zero indicates success. Otherwise, a GLU error code is returned (see gluErrorString).

For a description of the acceptable values for the format parameter, see glTexImage1D. For a description of the acceptable values for the type parameter, see glDrawPixels.


  Windows NT/2000: Requires Windows NT 3.5 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Glu.h.
  Library: Use Glu32.lib.

See Also

glDrawPixels, glTexImage1D, gluBuild2DMipmaps, gluScaleImage


Community Additions

© 2016 Microsoft