glu.BuildMipmaps -- create 1D or 2D mipmaps
error = glu.BuildMipmaps(internalformat, format, pixels)
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.

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

Show TOC