<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
<!-- saved from url=(0013)about:internet -->
<?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>glGenerateMipmap</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /></head><body><div class="refentry"><a id="glGenerateMipmap"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glGenerateMipmap — generate a complete set of mipmaps for a texture object</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glGenerateMipmap</strong>(</code></td><td>GLenum <var class="pdparam">target</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>target</code></em></span></dt><dd><p>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: <code class="constant">GL_TEXTURE_2D</code> or
		    <code class="constant">GL_TEXTURE_CUBE_MAP</code>.</p></dd></dl></div></div><div class="refsect1"><a id="description"></a><h2>Description</h2><p><code class="function">glGenerateMipmap</code> 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.</p><p>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.</p><p>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. 
	<a class="citerefentry" href="glHint.xml"><span class="citerefentry"><span class="refentrytitle">glHint</span></span></a> may be called
	to express a preference for speed or quality of filtering.</p></div><div class="refsect1"><a id="errors"></a><h2>Errors</h2><p><code class="constant">GL_INVALID_ENUM</code> is generated if
	<em class="parameter"><code>target</code></em> is not <code class="constant">GL_TEXTURE_2D</code> or
	<code class="constant">GL_TEXTURE_CUBE_MAP</code>.</p><p><code class="constant">GL_INVALID_OPERATION</code> is generated if
	the texture bound to <em class="parameter"><code>target</code></em> is a cube map, but its
	six faces do not share identical widths, heights, formats, and types.</p><p><code class="constant">GL_INVALID_OPERATION</code> is generated if
	either the width or height of the zero level array is not a power of two.</p><p><code class="constant">GL_INVALID_OPERATION</code> is generated if
	the zero level array is stored in a compressed internal format.</p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p><a class="citerefentry" href="glBindTexture.xml"><span class="citerefentry"><span class="refentrytitle">glBindTexture</span></span></a>,
	<a class="citerefentry" href="glFramebufferTexture2D.xml"><span class="citerefentry"><span class="refentrytitle">glFramebufferTexture2D</span></span></a>,
	<a class="citerefentry" href="glHint.xml"><span class="citerefentry"><span class="refentrytitle">glHint</span></span></a>,
	<a class="citerefentry" href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>,
	<a class="citerefentry" href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a></p></div><div class="refsect1"><a id="copyright"></a><h2>Copyright</h2><p>
            Copyright <span class="trademark"></span>© 2008 Khronos Group. 
            This material may be distributed subject to the terms and conditions set forth in 
            the Open Publication License, v 1.0, 8 June 1999.
            <a class="ulink" href="http://opencontent.org/openpub/" target="_top">http://opencontent.org/openpub/</a>.
        </p></div></div></body></html>