Creates 2-dimensional (2D) mipmaps.
OpenGL C bindings library: libGL.a
int gluBuild2DMipmaps(GLenum Target, GLint Components, GLintWidth, GLint Height, GLenum Format, GLenum Type, const void *Data)
The gluBuild2DMipmaps subroutine obtains the input image and uses the gluScaleImage subroutine to generate all mipmap images necessary so that the input image can be used as a mipmapped texture image. The glTexImage2D subroutine is then called to load each of the images. If the dimensions of the input image are not powers of two, the image is scaled so that both the width and height are powers 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_2D. |
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. |
Height | Specifies the height of the texture image. |
Format | Specifies the format of the pixel data. The following symbolic values are valid: |
(See the glTexImage1D subroutine for 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 glDrawPixels subroutine, glTexImage1D subroutine, glTexImage2D subroutine, gluBuild1DMipmaps subroutine, gluErrorString subroutine, gluScaleImage subroutine.