Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN" | |
3 | "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd"> | |
4 | <refentry id="glGenerateMipmap"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>2010</year> | |
9 | <holder>Khronos Group</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glGenerateMipmap</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glGenerateMipmap</refname> | |
17 | <refpurpose>generate mipmaps for a specified texture target</refpurpose> | |
18 | </refnamediv> | |
19 | <refsynopsisdiv><title>C Specification</title> | |
20 | <funcsynopsis> | |
21 | <funcprototype> | |
22 | <funcdef>void <function>glGenerateMipmap</function></funcdef> | |
23 | <paramdef>GLenum <parameter>target</parameter></paramdef> | |
24 | </funcprototype> | |
25 | </funcsynopsis> | |
26 | </refsynopsisdiv> | |
27 | <!-- eqn: ignoring delim $$ --> | |
28 | <refsect1 id="parameters"><title>Parameters</title> | |
29 | <variablelist> | |
30 | <varlistentry> | |
31 | <term><parameter>target</parameter></term> | |
32 | <listitem> | |
33 | <para> | |
34 | Specifies the target to which the texture whose mimaps to generate is bound. <parameter>target</parameter> must | |
35 | be <constant>GL_TEXTURE_1D</constant>, <constant>GL_TEXTURE_2D</constant>, <constant>GL_TEXTURE_3D</constant>, | |
36 | <constant>GL_TEXTURE_1D_ARRAY</constant>, <constant>GL_TEXTURE_2D_ARRAY</constant> or | |
37 | <constant>GL_TEXTURE_CUBE_MAP</constant>. | |
38 | </para> | |
39 | </listitem> | |
40 | </varlistentry> | |
41 | </variablelist> | |
42 | </refsect1> | |
43 | <refsect1 id="description"><title>Description</title> | |
44 | <para> | |
45 | <function>glGenerateMipmap</function> generates mipmaps for the texture attached | |
46 | to <parameter>target</parameter> of the active texture unit. For cube map textures, | |
47 | a <constant>GL_INVALID_OPERATION</constant> error is generated if the texture | |
48 | attached to <parameter>target</parameter> is not cube complete. | |
49 | </para> | |
50 | <para> | |
51 | Mipmap generation replaces texel array levels | |
52 | <inlineequation><mml:math> | |
53 | <!-- eqn: level sub base + 1: --> | |
54 | <mml:mrow> | |
55 | <mml:msub> | |
56 | <mml:mi mathvariant="italic">level</mml:mi> | |
57 | <mml:mi>base</mml:mi> | |
58 | </mml:msub> | |
59 | <mml:mo>+</mml:mo> | |
60 | <mml:mn>1</mml:mn> | |
61 | </mml:mrow> | |
62 | </mml:math></inlineequation> | |
63 | through | |
64 | <inlineequation><mml:math> | |
65 | <mml:mrow> | |
66 | <mml:mi mathvariant="italic">q</mml:mi> | |
67 | </mml:mrow> | |
68 | </mml:math></inlineequation> | |
69 | with arrays derived from the | |
70 | <inlineequation><mml:math> | |
71 | <!-- eqn: level sub base + 1: --> | |
72 | <mml:mrow> | |
73 | <mml:msub> | |
74 | <mml:mi mathvariant="italic">level</mml:mi> | |
75 | <mml:mi>base</mml:mi> | |
76 | </mml:msub> | |
77 | </mml:mrow> | |
78 | </mml:math></inlineequation> | |
79 | array, regardless of their previous contents. All other mimap arrays, | |
80 | including the | |
81 | <inlineequation><mml:math> | |
82 | <!-- eqn: level sub base + 1: --> | |
83 | <mml:mrow> | |
84 | <mml:msub> | |
85 | <mml:mi mathvariant="italic">level</mml:mi> | |
86 | <mml:mi>base</mml:mi> | |
87 | </mml:msub> | |
88 | </mml:mrow> | |
89 | </mml:math></inlineequation> | |
90 | array, are left unchanged by this computation. | |
91 | </para> | |
92 | <para> | |
93 | The internal formats of the derived mipmap arrays all match those of the | |
94 | <inlineequation><mml:math> | |
95 | <!-- eqn: level sub base + 1: --> | |
96 | <mml:mrow> | |
97 | <mml:msub> | |
98 | <mml:mi mathvariant="italic">level</mml:mi> | |
99 | <mml:mi>base</mml:mi> | |
100 | </mml:msub> | |
101 | </mml:mrow> | |
102 | </mml:math></inlineequation> | |
103 | array. The contents of the derived arrays are computed by repeated, filtered | |
104 | reduction of the | |
105 | <inlineequation><mml:math> | |
106 | <!-- eqn: level sub base + 1: --> | |
107 | <mml:mrow> | |
108 | <mml:msub> | |
109 | <mml:mi mathvariant="italic">level</mml:mi> | |
110 | <mml:mi>base</mml:mi> | |
111 | </mml:msub> | |
112 | </mml:mrow> | |
113 | </mml:math></inlineequation> | |
114 | array. For one- and two-dimensional texture arrays, each layer is filtered | |
115 | independently. | |
116 | </para> | |
117 | </refsect1> | |
118 | <refsect1 id="errors"><title>Errors</title> | |
119 | <para> | |
120 | <constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not | |
121 | one of the accepted texture targets. | |
122 | </para> | |
123 | <para> | |
124 | <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>target</parameter> is | |
125 | <constant>GL_TEXTURE_CUBE_MAP</constant> and the texture bound to the <constant>GL_TEXTURE_CUBE_MAP</constant> | |
126 | target of the active texture unit is not cube complete. | |
127 | </para> | |
128 | </refsect1> | |
129 | <refsect1 id="seealso"><title>See Also</title> | |
130 | <para> | |
131 | <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>, | |
132 | <citerefentry><refentrytitle>glBindTexture</refentrytitle></citerefentry>, | |
133 | <citerefentry><refentrytitle>glGenTextures</refentrytitle></citerefentry> | |
134 | </para> | |
135 | </refsect1> | |
136 | <refsect1 id="Copyright"><title>Copyright</title> | |
137 | <para> | |
138 | Copyright <trademark class="copyright"></trademark> 2010 Khronos Group. | |
139 | This material may be distributed subject to the terms and conditions set forth in | |
140 | the Open Publication License, v 1.0, 8 June 1999. | |
141 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>. | |
142 | </para> | |
143 | </refsect1> | |
144 | </refentry> |