[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

gluBuild1DMipmaps Subroutine

Purpose

Creates 1-dimensional (1D) mipmaps.

Library

OpenGL C bindings library: libGL.a

C Syntax

int gluBuild1DMipmaps(GLenum Target,
   GLint Components,
   GLint Width,
   GLenum Format,
   GLenum Type,
   const void *Data)

Description

The gluBuild1DMipmaps subroutine obtains the input image information and uses the gluScaleImage subroutine to generate the mipmap images necessary to allow the input image to be used as a mipmapped texture image. The glTexImage1D subroutine is then called to load each of the images. If the width of the input image is not a power of two, 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 the gluErrorString subroutine.)

See the glTexImage1D subroutine for a description of the acceptable values for the Format parameter. See the glDrawPixels subroutine for acceptable values for the Type parameter.

Parameters

Target Specifies the target texture. This value must be GL_TEXTURE_1D.
Components Specifies the number of color components in the texture. Values must be 1, 2, 3, or 4 only.
Width Specifies the width of the texture image.
Format Specifies the format of the pixel data. The following symbolic values are valid:
  • GL_COLOR_INDEX
  • GL_RED
  • GL_GREEN
  • GL_BLUE
  • GL_ALPHA
  • GL_RGB
  • GL_RGBA
  • GL_LUMINANCE
  • GL_LUMINANCE_ALPHA
(See the glTexImage1D subroutine for a description of the acceptable values for the Format parameter.)
Type Specifies the data type. The following data types are valid:
  • GL_UNSIGNED_BYTE
  • GL_BYTE
  • GL_BITMAP
  • GL_UNSIGNED_SHORT
  • GL_SHORT
  • GL_UNSIGNED_INT
  • GL_INT
  • GL_FLOAT
(See the glDrawPixels subroutine for acceptable values for the Type parameter.)
Data Specifies a pointer to the image data in memory.

Return Values

0 Indicates the mipmap images were successfully built. Otherwise, a GLU error code is returned. (See the gluErrorString subroutine for standard GLU error codes.)

Files

/usr/include/GL/gl.h Contains C language constraints, variable type definitions, and ANSI function prototypes for OpenGL.

Related Information

The glTexImage1D subroutine, gluBuild2DMipmaps subroutine, gluErrorString subroutine, gluScaleImage subroutine.

OpenGL Overview.


[ Previous | Next | Contents | Glossary | Home | Search ]