Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> |
2 | <!-- saved from url=(0013)about:internet --> | |
3 | <?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>glNewList</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glNewList"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glNewList — create or replace a display list</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glNewList</b>(</code></td><td>GLuint </td><td><var class="pdparam">list</var>, </td></tr><tr><td> </td><td>GLenum </td><td><var class="pdparam">mode</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>list</code></em></span></dt><dd><p> | |
4 | Specifies the display-list name. | |
5 | </p></dd><dt><span class="term"><em class="parameter"><code>mode</code></em></span></dt><dd><p> | |
6 | Specifies the compilation mode, | |
7 | which can be | |
8 | <code class="constant">GL_COMPILE</code> or | |
9 | <code class="constant">GL_COMPILE_AND_EXECUTE</code>. | |
10 | </p></dd></dl></div></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glEndList</b>(</code></td><td> </td><td><var class="pdparam">void</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
11 | Display lists are groups of GL commands that have been stored | |
12 | for subsequent execution. | |
13 | Display lists are created with <code class="function">glNewList</code>. | |
14 | All subsequent commands are placed in the display list, | |
15 | in the order issued, | |
16 | until <a class="citerefentry" href="glEndList.xml"><span class="citerefentry"><span class="refentrytitle">glEndList</span></span></a> is called. | |
17 | </p><p> | |
18 | <code class="function">glNewList</code> has two arguments. | |
19 | The first argument, | |
20 | <em class="parameter"><code>list</code></em>, | |
21 | is a positive integer that becomes the unique name for the display list. | |
22 | Names can be created and reserved with <a class="citerefentry" href="glGenLists.xml"><span class="citerefentry"><span class="refentrytitle">glGenLists</span></span></a> | |
23 | and tested for uniqueness with <a class="citerefentry" href="glIsList.xml"><span class="citerefentry"><span class="refentrytitle">glIsList</span></span></a>. | |
24 | The second argument, | |
25 | <em class="parameter"><code>mode</code></em>, | |
26 | is a symbolic constant that can assume one of two values: | |
27 | </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_COMPILE</code></span></dt><dd><p> | |
28 | Commands are merely compiled. | |
29 | </p></dd><dt><span class="term"><code class="constant">GL_COMPILE_AND_EXECUTE</code></span></dt><dd><p> | |
30 | Commands are executed as they are compiled into the display list. | |
31 | </p></dd></dl></div><p> | |
32 | Certain commands are not compiled into the display list | |
33 | but are executed immediately, | |
34 | regardless of the display-list mode. | |
35 | These commands are | |
36 | <a class="citerefentry" href="glAreTexturesResident.xml"><span class="citerefentry"><span class="refentrytitle">glAreTexturesResident</span></span></a>, | |
37 | <a class="citerefentry" href="glColorPointer.xml"><span class="citerefentry"><span class="refentrytitle">glColorPointer</span></span></a>, | |
38 | <a class="citerefentry" href="glDeleteLists.xml"><span class="citerefentry"><span class="refentrytitle">glDeleteLists</span></span></a>, | |
39 | <a class="citerefentry" href="glDeleteTextures.xml"><span class="citerefentry"><span class="refentrytitle">glDeleteTextures</span></span></a>, | |
40 | <a class="citerefentry" href="glDisableClientState.xml"><span class="citerefentry"><span class="refentrytitle">glDisableClientState</span></span></a>, | |
41 | <a class="citerefentry" href="glEdgeFlagPointer.xml"><span class="citerefentry"><span class="refentrytitle">glEdgeFlagPointer</span></span></a>, | |
42 | <a class="citerefentry" href="glEnableClientState.xml"><span class="citerefentry"><span class="refentrytitle">glEnableClientState</span></span></a>, | |
43 | <a class="citerefentry" href="glFeedbackBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glFeedbackBuffer</span></span></a>, | |
44 | <a class="citerefentry" href="glFinish.xml"><span class="citerefentry"><span class="refentrytitle">glFinish</span></span></a>, | |
45 | <a class="citerefentry" href="glFlush.xml"><span class="citerefentry"><span class="refentrytitle">glFlush</span></span></a>, | |
46 | <a class="citerefentry" href="glGenLists.xml"><span class="citerefentry"><span class="refentrytitle">glGenLists</span></span></a>, | |
47 | <a class="citerefentry" href="glGenTextures.xml"><span class="citerefentry"><span class="refentrytitle">glGenTextures</span></span></a>, | |
48 | <a class="citerefentry" href="glIndexPointer.xml"><span class="citerefentry"><span class="refentrytitle">glIndexPointer</span></span></a>, | |
49 | <a class="citerefentry" href="glInterleavedArrays.xml"><span class="citerefentry"><span class="refentrytitle">glInterleavedArrays</span></span></a>, | |
50 | <a class="citerefentry" href="glIsEnabled.xml"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a>, | |
51 | <a class="citerefentry" href="glIsList.xml"><span class="citerefentry"><span class="refentrytitle">glIsList</span></span></a>, | |
52 | <a class="citerefentry" href="glIsTexture.xml"><span class="citerefentry"><span class="refentrytitle">glIsTexture</span></span></a>, | |
53 | <a class="citerefentry" href="glNormalPointer.xml"><span class="citerefentry"><span class="refentrytitle">glNormalPointer</span></span></a>, | |
54 | <a class="citerefentry" href="glPopClientAttrib.xml"><span class="citerefentry"><span class="refentrytitle">glPopClientAttrib</span></span></a>, | |
55 | <a class="citerefentry" href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>, | |
56 | <a class="citerefentry" href="glPushClientAttrib.xml"><span class="citerefentry"><span class="refentrytitle">glPushClientAttrib</span></span></a>, | |
57 | <a class="citerefentry" href="glReadPixels.xml"><span class="citerefentry"><span class="refentrytitle">glReadPixels</span></span></a>, | |
58 | <a class="citerefentry" href="glRenderMode.xml"><span class="citerefentry"><span class="refentrytitle">glRenderMode</span></span></a>, | |
59 | <a class="citerefentry" href="glSelectBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glSelectBuffer</span></span></a>, | |
60 | <a class="citerefentry" href="glTexCoordPointer.xml"><span class="citerefentry"><span class="refentrytitle">glTexCoordPointer</span></span></a>, | |
61 | <a class="citerefentry" href="glVertexPointer.xml"><span class="citerefentry"><span class="refentrytitle">glVertexPointer</span></span></a>, | |
62 | and all of the <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> commands. | |
63 | </p><p> | |
64 | Similarly, | |
65 | <a class="citerefentry" href="glTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage1D</span></span></a>, <a class="citerefentry" href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>, and <a class="citerefentry" href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a> | |
66 | are executed immediately and not compiled into the display list when their | |
67 | first argument is <code class="constant">GL_PROXY_TEXTURE_1D</code>, <code class="constant">GL_PROXY_TEXTURE_1D</code>, or | |
68 | <code class="constant">GL_PROXY_TEXTURE_3D</code>, respectively. | |
69 | </p><p> | |
70 | When the <code class="code">ARB_imaging</code> extension is supported, | |
71 | <a class="citerefentry" href="glHistogram.xml"><span class="citerefentry"><span class="refentrytitle">glHistogram</span></span></a> executes immediately when its argument is | |
72 | <code class="constant">GL_PROXY_HISTOGRAM</code>. Similarly, <a class="citerefentry" href="glColorTable.xml"><span class="citerefentry"><span class="refentrytitle">glColorTable</span></span></a> executes | |
73 | immediately when its first argument is <code class="constant">GL_PROXY_COLOR_TABLE</code>, | |
74 | <code class="constant">GL_PROXY_POST_CONVOLUTION_COLOR_TABLE</code>, or | |
75 | <code class="constant">GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE</code>. | |
76 | </p><p> | |
77 | For OpenGL versions 1.3 and greater, or when the <code class="code">ARB_multitexture</code> extension is supported, | |
78 | <a class="citerefentry" href="glClientActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glClientActiveTexture</span></span></a> is not compiled into display lists, but | |
79 | executed immediately. | |
80 | </p><p> | |
81 | When <a class="citerefentry" href="glEndList.xml"><span class="citerefentry"><span class="refentrytitle">glEndList</span></span></a> is encountered, | |
82 | the display-list definition is completed by associating the list | |
83 | with the unique name <em class="parameter"><code>list</code></em> | |
84 | (specified in the <code class="function">glNewList</code> command). | |
85 | If a display list with name <em class="parameter"><code>list</code></em> already exists, | |
86 | it is replaced only when <a class="citerefentry" href="glEndList.xml"><span class="citerefentry"><span class="refentrytitle">glEndList</span></span></a> is called. | |
87 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p> | |
88 | <a class="citerefentry" href="glCallList.xml"><span class="citerefentry"><span class="refentrytitle">glCallList</span></span></a> and <a class="citerefentry" href="glCallLists.xml"><span class="citerefentry"><span class="refentrytitle">glCallLists</span></span></a> can be entered into display lists. | |
89 | Commands in the display list or lists executed by <a class="citerefentry" href="glCallList.xml"><span class="citerefentry"><span class="refentrytitle">glCallList</span></span></a> | |
90 | or <a class="citerefentry" href="glCallLists.xml"><span class="citerefentry"><span class="refentrytitle">glCallLists</span></span></a> are not included in the display list being created, | |
91 | even if the list creation mode is <code class="constant">GL_COMPILE_AND_EXECUTE</code>. | |
92 | </p><p> | |
93 | A display list is just a group of commands and arguments, so errors | |
94 | generated by commands in a display list must be generated when the list is | |
95 | executed. If the list is created in <code class="constant">GL_COMPILE</code> mode, errors are | |
96 | not generated until the list is executed. | |
97 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
98 | <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>list</code></em> is 0. | |
99 | </p><p> | |
100 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>mode</code></em> is not an accepted value. | |
101 | </p><p> | |
102 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <a class="citerefentry" href="glEndList.xml"><span class="citerefentry"><span class="refentrytitle">glEndList</span></span></a> is called | |
103 | without a preceding <code class="function">glNewList</code>, | |
104 | or if <code class="function">glNewList</code> is called while a display list is being defined. | |
105 | </p><p> | |
106 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glNewList</code> or <a class="citerefentry" href="glEndList.xml"><span class="citerefentry"><span class="refentrytitle">glEndList</span></span></a> | |
107 | is executed between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a> | |
108 | and the corresponding execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
109 | </p><p> | |
110 | <code class="constant">GL_OUT_OF_MEMORY</code> is generated if there is insufficient memory to | |
111 | compile the display list. If the GL version is 1.1 or greater, no | |
112 | change is made to the previous contents of the display list, if any, | |
113 | and no other change is made to the GL state. (It is as if no attempt | |
114 | had been made to create the new display list.) | |
115 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p> | |
116 | <a class="citerefentry" href="glIsList.xml"><span class="citerefentry"><span class="refentrytitle">glIsList</span></span></a> | |
117 | </p><p> | |
118 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_LIST_INDEX</code> | |
119 | </p><p> | |
120 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_LIST_MODE</code> | |
121 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
122 | <a class="citerefentry" href="glCallList.xml"><span class="citerefentry"><span class="refentrytitle">glCallList</span></span></a>, | |
123 | <a class="citerefentry" href="glCallLists.xml"><span class="citerefentry"><span class="refentrytitle">glCallLists</span></span></a>, | |
124 | <a class="citerefentry" href="glDeleteLists.xml"><span class="citerefentry"><span class="refentrytitle">glDeleteLists</span></span></a>, | |
125 | <a class="citerefentry" href="glGenLists.xml"><span class="citerefentry"><span class="refentrytitle">glGenLists</span></span></a> | |
126 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
127 | Copyright <span class="trademark"></span>© 1991-2006 | |
128 | Silicon Graphics, Inc. This document is licensed under the SGI | |
129 | Free Software B License. For details, see | |
130 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
131 | </p></div></div></body></html> |