Name
glu.BuildMipmaps -- create 1D or 2D mipmaps
Synopsis
error = glu.BuildMipmaps(internalformat, format, pixels)
Function
This function does the same as glu.Build1DMipmaps() and gl.Build2DMipmaps() except that the pixel data is not passed in a raw memory buffer but as table containing one subtable for each row of pixels. This is of course not as efficient as using raw memory buffers because the table's pixel data has to be copied to a raw memory buffer first.

Width and height of the texture will be automatically determined by the layout of the table in pixels. If there is only one subtable within pixels, gl.BuildMipmaps() will create 1D mipmaps. If there are multiple subtables within pixels, 2D mipmaps will be created.

Note that #GL_UNSIGNED_BYTE is currently the only supported data type. glu.BuildMipmaps() expects all elements in pixels to use the #GL_UNSIGNED_BYTE data type.

See glu.Build2DMipmaps for more details on the parameters accepted by this function.

Please consult an OpenGL reference manual for more information.

Inputs
internalFormat
specifies the internal format of the texture; must be one of the pixel format constants (see above)
format
specifies the format of the pixel data (see above)
pixels
specifies a table containing the pixel data
Results
error
error code or 0 for success

Show TOC