# glGenerateMipmap

Definition: | include pGUI.e include opengl.e glGenerateMipmap(integer target)
Description: | generate a complete set of mipmaps for a texture object target: Specifies the texture target of the active texture unit to which the texture object is bound whose mipmaps will be generated. Must be one of the following symbolic constants: GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP. glGenerateMipmap computes a complete set of mipmap arrays derived from the zero level array. Array levels up to and including the 1x1 dimension texture image are replaced with the derived arrays, regardless of previous contents. The zero level texture image is left unchanged. The internal formats of the derived mipmap arrays all match those of the zero level texture image. The dimensions of the derived arrays are computed by halving the width and height of the zero level texture image, then in turn halving the dimensions of each array level until the 1x1 dimension texture image is reached. The contents of the derived arrays are computed by repeated filtered reduction of the zero level array. No particular filter algorithm is required, though a box filter is recommended. glHint may be called to express a preference for speed or quality of filtering.
pwa/p2js: | Not supported.
Notes: | Like buffer and texture objects, the name space for program objects may be shared across a set of contexts, as long as the server sides of the contexts share the same address space. If the name space is shared across contexts, any attached objects and the data associated with those attached objects are shared as well. Applications are responsible for providing the synchronization across API calls when objects are accessed from different execution threads.
Errors: | GL_INVALID_ENUM is generated if target is not GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP. GL_INVALID_OPERATION is generated if the texture bound to target is a cube map, but its six faces do not share indentical widths, heights, formats, and types. GL_INVALID_OPERATION is generated if either the width or height of the zero level array is not a power of two. GL_INVALID_OPERATION is generated if the zero level array is stored in a compressed internal format.
See Also: | glBindTexture, xor_bits, glHint, glTexImage2Dc, glTexParameteri DEV See Also //glBindTexture, glFramebufferTexture2D, //glHint, //glTexImage2D, //glTexParameter