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="glNewList"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>1991-2006</year> | |
9 | <holder>Silicon Graphics, Inc.</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glNewList</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glNewList</refname> | |
17 | <refpurpose>create or replace a display list</refpurpose> | |
18 | </refnamediv> | |
19 | <refsynopsisdiv><title>C Specification</title> | |
20 | <funcsynopsis> | |
21 | <funcprototype> | |
22 | <funcdef>void <function>glNewList</function></funcdef> | |
23 | <paramdef>GLuint <parameter>list</parameter></paramdef> | |
24 | <paramdef>GLenum <parameter>mode</parameter></paramdef> | |
25 | </funcprototype> | |
26 | </funcsynopsis> | |
27 | </refsynopsisdiv> | |
28 | <refsect1 id="parameters"><title>Parameters</title> | |
29 | <variablelist> | |
30 | <varlistentry> | |
31 | <term><parameter>list</parameter></term> | |
32 | <listitem> | |
33 | <para> | |
34 | Specifies the display-list name. | |
35 | </para> | |
36 | </listitem> | |
37 | </varlistentry> | |
38 | <varlistentry> | |
39 | <term><parameter>mode</parameter></term> | |
40 | <listitem> | |
41 | <para> | |
42 | Specifies the compilation mode, | |
43 | which can be | |
44 | <constant>GL_COMPILE</constant> or | |
45 | <constant>GL_COMPILE_AND_EXECUTE</constant>. | |
46 | </para> | |
47 | </listitem> | |
48 | </varlistentry> | |
49 | </variablelist> | |
50 | </refsect1> | |
51 | <refsynopsisdiv><title>C Specification</title> | |
52 | <funcsynopsis> | |
53 | <funcprototype> | |
54 | <funcdef>void <function>glEndList</function></funcdef> | |
55 | <paramdef> <parameter>void</parameter></paramdef> | |
56 | </funcprototype> | |
57 | </funcsynopsis> | |
58 | </refsynopsisdiv> | |
59 | <refsect1 id="description"><title>Description</title> | |
60 | <para> | |
61 | Display lists are groups of GL commands that have been stored | |
62 | for subsequent execution. | |
63 | Display lists are created with <function>glNewList</function>. | |
64 | All subsequent commands are placed in the display list, | |
65 | in the order issued, | |
66 | until <citerefentry><refentrytitle>glEndList</refentrytitle></citerefentry> is called. | |
67 | </para> | |
68 | <para> | |
69 | <function>glNewList</function> has two arguments. | |
70 | The first argument, | |
71 | <parameter>list</parameter>, | |
72 | is a positive integer that becomes the unique name for the display list. | |
73 | Names can be created and reserved with <citerefentry><refentrytitle>glGenLists</refentrytitle></citerefentry> | |
74 | and tested for uniqueness with <citerefentry><refentrytitle>glIsList</refentrytitle></citerefentry>. | |
75 | The second argument, | |
76 | <parameter>mode</parameter>, | |
77 | is a symbolic constant that can assume one of two values: | |
78 | </para> | |
79 | <variablelist> | |
80 | <varlistentry> | |
81 | <term><constant>GL_COMPILE</constant></term> | |
82 | <listitem> | |
83 | <para> | |
84 | Commands are merely compiled. | |
85 | </para> | |
86 | </listitem> | |
87 | </varlistentry> | |
88 | <varlistentry> | |
89 | <term><constant>GL_COMPILE_AND_EXECUTE</constant></term> | |
90 | <listitem> | |
91 | <para> | |
92 | Commands are executed as they are compiled into the display list. | |
93 | </para> | |
94 | </listitem> | |
95 | </varlistentry> | |
96 | </variablelist> | |
97 | <para> | |
98 | Certain commands are not compiled into the display list | |
99 | but are executed immediately, | |
100 | regardless of the display-list mode. | |
101 | These commands are | |
102 | <citerefentry><refentrytitle>glAreTexturesResident</refentrytitle></citerefentry>, | |
103 | <citerefentry><refentrytitle>glColorPointer</refentrytitle></citerefentry>, | |
104 | <citerefentry><refentrytitle>glDeleteLists</refentrytitle></citerefentry>, | |
105 | <citerefentry><refentrytitle>glDeleteTextures</refentrytitle></citerefentry>, | |
106 | <citerefentry><refentrytitle>glDisableClientState</refentrytitle></citerefentry>, | |
107 | <citerefentry><refentrytitle>glEdgeFlagPointer</refentrytitle></citerefentry>, | |
108 | <citerefentry><refentrytitle>glEnableClientState</refentrytitle></citerefentry>, | |
109 | <citerefentry><refentrytitle>glFeedbackBuffer</refentrytitle></citerefentry>, | |
110 | <citerefentry><refentrytitle>glFinish</refentrytitle></citerefentry>, | |
111 | <citerefentry><refentrytitle>glFlush</refentrytitle></citerefentry>, | |
112 | <citerefentry><refentrytitle>glGenLists</refentrytitle></citerefentry>, | |
113 | <citerefentry><refentrytitle>glGenTextures</refentrytitle></citerefentry>, | |
114 | <citerefentry><refentrytitle>glIndexPointer</refentrytitle></citerefentry>, | |
115 | <citerefentry><refentrytitle>glInterleavedArrays</refentrytitle></citerefentry>, | |
116 | <citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry>, | |
117 | <citerefentry><refentrytitle>glIsList</refentrytitle></citerefentry>, | |
118 | <citerefentry><refentrytitle>glIsTexture</refentrytitle></citerefentry>, | |
119 | <citerefentry><refentrytitle>glNormalPointer</refentrytitle></citerefentry>, | |
120 | <citerefentry><refentrytitle>glPopClientAttrib</refentrytitle></citerefentry>, | |
121 | <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>, | |
122 | <citerefentry><refentrytitle>glPushClientAttrib</refentrytitle></citerefentry>, | |
123 | <citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry>, | |
124 | <citerefentry><refentrytitle>glRenderMode</refentrytitle></citerefentry>, | |
125 | <citerefentry><refentrytitle>glSelectBuffer</refentrytitle></citerefentry>, | |
126 | <citerefentry><refentrytitle>glTexCoordPointer</refentrytitle></citerefentry>, | |
127 | <citerefentry><refentrytitle>glVertexPointer</refentrytitle></citerefentry>, | |
128 | and all of the <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> commands. | |
129 | </para> | |
130 | <para> | |
131 | Similarly, | |
132 | <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>, and <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry> | |
133 | are executed immediately and not compiled into the display list when their | |
134 | first argument is <constant>GL_PROXY_TEXTURE_1D</constant>, <constant>GL_PROXY_TEXTURE_1D</constant>, or | |
135 | <constant>GL_PROXY_TEXTURE_3D</constant>, respectively. | |
136 | </para> | |
137 | <para> | |
138 | When the <code>ARB_imaging</code> extension is supported, | |
139 | <citerefentry><refentrytitle>glHistogram</refentrytitle></citerefentry> executes immediately when its argument is | |
140 | <constant>GL_PROXY_HISTOGRAM</constant>. Similarly, <citerefentry><refentrytitle>glColorTable</refentrytitle></citerefentry> executes | |
141 | immediately when its first argument is <constant>GL_PROXY_COLOR_TABLE</constant>, | |
142 | <constant>GL_PROXY_POST_CONVOLUTION_COLOR_TABLE</constant>, or | |
143 | <constant>GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE</constant>. | |
144 | </para> | |
145 | <para> | |
146 | For OpenGL versions 1.3 and greater, or when the <code>ARB_multitexture</code> extension is supported, | |
147 | <citerefentry><refentrytitle>glClientActiveTexture</refentrytitle></citerefentry> is not compiled into display lists, but | |
148 | executed immediately. | |
149 | </para> | |
150 | <para> | |
151 | When <citerefentry><refentrytitle>glEndList</refentrytitle></citerefentry> is encountered, | |
152 | the display-list definition is completed by associating the list | |
153 | with the unique name <parameter>list</parameter> | |
154 | (specified in the <function>glNewList</function> command). | |
155 | If a display list with name <parameter>list</parameter> already exists, | |
156 | it is replaced only when <citerefentry><refentrytitle>glEndList</refentrytitle></citerefentry> is called. | |
157 | </para> | |
158 | </refsect1> | |
159 | <refsect1 id="notes"><title>Notes</title> | |
160 | <para> | |
161 | <citerefentry><refentrytitle>glCallList</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glCallLists</refentrytitle></citerefentry> can be entered into display lists. | |
162 | Commands in the display list or lists executed by <citerefentry><refentrytitle>glCallList</refentrytitle></citerefentry> | |
163 | or <citerefentry><refentrytitle>glCallLists</refentrytitle></citerefentry> are not included in the display list being created, | |
164 | even if the list creation mode is <constant>GL_COMPILE_AND_EXECUTE</constant>. | |
165 | </para> | |
166 | <para> | |
167 | A display list is just a group of commands and arguments, so errors | |
168 | generated by commands in a display list must be generated when the list is | |
169 | executed. If the list is created in <constant>GL_COMPILE</constant> mode, errors are | |
170 | not generated until the list is executed. | |
171 | </para> | |
172 | </refsect1> | |
173 | <refsect1 id="errors"><title>Errors</title> | |
174 | <para> | |
175 | <constant>GL_INVALID_VALUE</constant> is generated if <parameter>list</parameter> is 0. | |
176 | </para> | |
177 | <para> | |
178 | <constant>GL_INVALID_ENUM</constant> is generated if <parameter>mode</parameter> is not an accepted value. | |
179 | </para> | |
180 | <para> | |
181 | <constant>GL_INVALID_OPERATION</constant> is generated if <citerefentry><refentrytitle>glEndList</refentrytitle></citerefentry> is called | |
182 | without a preceding <function>glNewList</function>, | |
183 | or if <function>glNewList</function> is called while a display list is being defined. | |
184 | </para> | |
185 | <para> | |
186 | <constant>GL_INVALID_OPERATION</constant> is generated if <function>glNewList</function> or <citerefentry><refentrytitle>glEndList</refentrytitle></citerefentry> | |
187 | is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> | |
188 | and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>. | |
189 | </para> | |
190 | <para> | |
191 | <constant>GL_OUT_OF_MEMORY</constant> is generated if there is insufficient memory to | |
192 | compile the display list. If the GL version is 1.1 or greater, no | |
193 | change is made to the previous contents of the display list, if any, | |
194 | and no other change is made to the GL state. (It is as if no attempt | |
195 | had been made to create the new display list.) | |
196 | </para> | |
197 | </refsect1> | |
198 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
199 | <para> | |
200 | <citerefentry><refentrytitle>glIsList</refentrytitle></citerefentry> | |
201 | </para> | |
202 | <para> | |
203 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_LIST_INDEX</constant> | |
204 | </para> | |
205 | <para> | |
206 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_LIST_MODE</constant> | |
207 | </para> | |
208 | </refsect1> | |
209 | <refsect1 id="seealso"><title>See Also</title> | |
210 | <para> | |
211 | <citerefentry><refentrytitle>glCallList</refentrytitle></citerefentry>, | |
212 | <citerefentry><refentrytitle>glCallLists</refentrytitle></citerefentry>, | |
213 | <citerefentry><refentrytitle>glDeleteLists</refentrytitle></citerefentry>, | |
214 | <citerefentry><refentrytitle>glGenLists</refentrytitle></citerefentry> | |
215 | </para> | |
216 | </refsect1> | |
217 | <refsect1 id="Copyright"><title>Copyright</title> | |
218 | <para> | |
219 | Copyright <trademark class="copyright"></trademark> 1991-2006 | |
220 | Silicon Graphics, Inc. This document is licensed under the SGI | |
221 | Free Software B License. For details, see | |
222 | <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>. | |
223 | </para> | |
224 | </refsect1> | |
225 | </refentry> |