Creates 1-dimensional (1D) mipmaps.
OpenGL C bindings library: libGL.a
int gluBuild1DMipmaps(GLenum Target, GLint Components, GLint Width, GLenum Format, GLenum Type, const void *Data)
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.
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: |
(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: |
(See the glDrawPixels subroutine for acceptable values for the Type parameter.) | |
Data | Specifies a pointer to the image data in memory. |
0 | Indicates the mipmap images were successfully built. Otherwise, a GLU error code is returned. (See the gluErrorString subroutine for standard GLU error codes.) |
/usr/include/GL/gl.h | Contains C language constraints, variable type definitions, and ANSI function prototypes for OpenGL. |
The glTexImage1D subroutine, gluBuild2DMipmaps subroutine, gluErrorString subroutine, gluScaleImage subroutine.