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>glBegin</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glBegin"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glBegin — delimit the vertices of a primitive or a group of like primitives</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">glBegin</b>(</code></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>mode</code></em></span></dt><dd><p> | |
4 | Specifies the primitive or primitives that will be created from vertices | |
5 | presented between <code class="function">glBegin</code> and the subsequent <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
6 | Ten symbolic constants are accepted: | |
7 | <code class="constant">GL_POINTS</code>, | |
8 | <code class="constant">GL_LINES</code>, | |
9 | <code class="constant">GL_LINE_STRIP</code>, | |
10 | <code class="constant">GL_LINE_LOOP</code>, | |
11 | <code class="constant">GL_TRIANGLES</code>, | |
12 | <code class="constant">GL_TRIANGLE_STRIP</code>, | |
13 | <code class="constant">GL_TRIANGLE_FAN</code>, | |
14 | <code class="constant">GL_QUADS</code>, | |
15 | <code class="constant">GL_QUAD_STRIP</code>, and | |
16 | <code class="constant">GL_POLYGON</code>. | |
17 | </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">glEnd</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> | |
18 | <code class="function">glBegin</code> and <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a> delimit the vertices that define a primitive or | |
19 | a group of like primitives. | |
20 | <code class="function">glBegin</code> accepts a single argument that specifies in which of ten ways the | |
21 | vertices are interpreted. | |
22 | Taking | |
23 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math> | |
24 | as an integer count starting at one, | |
25 | and | |
26 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">N</mml:mi></mml:math> | |
27 | as the total number of vertices specified, | |
28 | the interpretations are as follows: | |
29 | </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_POINTS</code></span></dt><dd><p> | |
30 | Treats each vertex as a single point. | |
31 | Vertex | |
32 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math> | |
33 | defines point | |
34 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>. | |
35 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">N</mml:mi></mml:math> | |
36 | points are drawn. | |
37 | </p></dd><dt><span class="term"><code class="constant">GL_LINES</code></span></dt><dd><p> | |
38 | Treats each pair of vertices as an independent line segment. | |
39 | Vertices | |
40 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
41 | ||
42 | <mml:mrow> | |
43 | <mml:mn>2</mml:mn> | |
44 | <mml:mo></mml:mo> | |
45 | <mml:mi mathvariant="italic">n</mml:mi> | |
46 | <mml:mo>-</mml:mo> | |
47 | <mml:mn>1</mml:mn> | |
48 | </mml:mrow> | |
49 | </mml:math> | |
50 | and | |
51 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
52 | ||
53 | <mml:mrow> | |
54 | <mml:mn>2</mml:mn> | |
55 | <mml:mo></mml:mo> | |
56 | <mml:mi mathvariant="italic">n</mml:mi> | |
57 | </mml:mrow> | |
58 | </mml:math> | |
59 | define line | |
60 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>. | |
61 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
62 | ||
63 | <mml:mfrac> | |
64 | <mml:mi mathvariant="italic">N</mml:mi> | |
65 | <mml:mn>2</mml:mn> | |
66 | </mml:mfrac> | |
67 | </mml:math> | |
68 | lines are drawn. | |
69 | </p></dd><dt><span class="term"><code class="constant">GL_LINE_STRIP</code></span></dt><dd><p> | |
70 | Draws a connected group of line segments from the first vertex | |
71 | to the last. | |
72 | Vertices | |
73 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math> | |
74 | and | |
75 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
76 | ||
77 | <mml:mrow> | |
78 | <mml:mi mathvariant="italic">n</mml:mi> | |
79 | <mml:mo>+</mml:mo> | |
80 | <mml:mn>1</mml:mn> | |
81 | </mml:mrow> | |
82 | </mml:math> | |
83 | define line | |
84 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>. | |
85 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
86 | ||
87 | <mml:mrow> | |
88 | <mml:mi mathvariant="italic">N</mml:mi> | |
89 | <mml:mo>-</mml:mo> | |
90 | <mml:mn>1</mml:mn> | |
91 | </mml:mrow> | |
92 | </mml:math> | |
93 | lines are drawn. | |
94 | </p></dd><dt><span class="term"><code class="constant">GL_LINE_LOOP</code></span></dt><dd><p> | |
95 | Draws a connected group of line segments from the first vertex | |
96 | to the last, | |
97 | then back to the first. | |
98 | Vertices | |
99 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math> | |
100 | and | |
101 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
102 | ||
103 | <mml:mrow> | |
104 | <mml:mi mathvariant="italic">n</mml:mi> | |
105 | <mml:mo>+</mml:mo> | |
106 | <mml:mn>1</mml:mn> | |
107 | </mml:mrow> | |
108 | </mml:math> | |
109 | define line | |
110 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>. | |
111 | The last line, however, is defined by vertices | |
112 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">N</mml:mi></mml:math> | |
113 | and | |
114 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
115 | ||
116 | <mml:mn>1</mml:mn> | |
117 | </mml:math>. | |
118 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">N</mml:mi></mml:math> | |
119 | lines are drawn. | |
120 | </p></dd><dt><span class="term"><code class="constant">GL_TRIANGLES</code></span></dt><dd><p> | |
121 | Treats each triplet of vertices as an independent triangle. | |
122 | Vertices | |
123 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
124 | ||
125 | <mml:mrow> | |
126 | <mml:mn>3</mml:mn> | |
127 | <mml:mo></mml:mo> | |
128 | <mml:mi mathvariant="italic">n</mml:mi> | |
129 | <mml:mo>-</mml:mo> | |
130 | <mml:mn>2</mml:mn> | |
131 | </mml:mrow> | |
132 | </mml:math>, | |
133 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
134 | ||
135 | <mml:mrow> | |
136 | <mml:mn>3</mml:mn> | |
137 | <mml:mo></mml:mo> | |
138 | <mml:mi mathvariant="italic">n</mml:mi> | |
139 | <mml:mo>-</mml:mo> | |
140 | <mml:mn>1</mml:mn> | |
141 | </mml:mrow> | |
142 | </mml:math>, | |
143 | and | |
144 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
145 | ||
146 | <mml:mrow> | |
147 | <mml:mn>3</mml:mn> | |
148 | <mml:mo></mml:mo> | |
149 | <mml:mi mathvariant="italic">n</mml:mi> | |
150 | </mml:mrow> | |
151 | </mml:math> | |
152 | define triangle | |
153 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>. | |
154 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
155 | ||
156 | <mml:mfrac> | |
157 | <mml:mi mathvariant="italic">N</mml:mi> | |
158 | <mml:mn>3</mml:mn> | |
159 | </mml:mfrac> | |
160 | </mml:math> | |
161 | triangles are drawn. | |
162 | </p></dd><dt><span class="term"><code class="constant">GL_TRIANGLE_STRIP</code></span></dt><dd><p> | |
163 | Draws a connected group of triangles. One triangle is defined for each | |
164 | vertex presented after the first two vertices. For odd | |
165 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>, | |
166 | vertices | |
167 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>, | |
168 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
169 | ||
170 | <mml:mrow> | |
171 | <mml:mi mathvariant="italic">n</mml:mi> | |
172 | <mml:mo>+</mml:mo> | |
173 | <mml:mn>1</mml:mn> | |
174 | </mml:mrow> | |
175 | </mml:math>, | |
176 | and | |
177 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
178 | ||
179 | <mml:mrow> | |
180 | <mml:mi mathvariant="italic">n</mml:mi> | |
181 | <mml:mo>+</mml:mo> | |
182 | <mml:mn>2</mml:mn> | |
183 | </mml:mrow> | |
184 | </mml:math> | |
185 | define triangle | |
186 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>. | |
187 | For even | |
188 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>, | |
189 | vertices | |
190 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
191 | ||
192 | <mml:mrow> | |
193 | <mml:mi mathvariant="italic">n</mml:mi> | |
194 | <mml:mo>+</mml:mo> | |
195 | <mml:mn>1</mml:mn> | |
196 | </mml:mrow> | |
197 | </mml:math>, | |
198 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>, | |
199 | and | |
200 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
201 | ||
202 | <mml:mrow> | |
203 | <mml:mi mathvariant="italic">n</mml:mi> | |
204 | <mml:mo>+</mml:mo> | |
205 | <mml:mn>2</mml:mn> | |
206 | </mml:mrow> | |
207 | </mml:math> | |
208 | define triangle | |
209 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>. | |
210 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
211 | ||
212 | <mml:mrow> | |
213 | <mml:mi mathvariant="italic">N</mml:mi> | |
214 | <mml:mo>-</mml:mo> | |
215 | <mml:mn>2</mml:mn> | |
216 | </mml:mrow> | |
217 | </mml:math> | |
218 | triangles are | |
219 | drawn. | |
220 | </p></dd><dt><span class="term"><code class="constant">GL_TRIANGLE_FAN</code></span></dt><dd><p> | |
221 | Draws a connected group of triangles. | |
222 | One triangle is defined for each vertex presented after the first two vertices. | |
223 | Vertices | |
224 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
225 | ||
226 | <mml:mn>1</mml:mn> | |
227 | </mml:math>, | |
228 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
229 | ||
230 | <mml:mrow> | |
231 | <mml:mi mathvariant="italic">n</mml:mi> | |
232 | <mml:mo>+</mml:mo> | |
233 | <mml:mn>1</mml:mn> | |
234 | </mml:mrow> | |
235 | </mml:math>, | |
236 | and | |
237 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
238 | ||
239 | <mml:mrow> | |
240 | <mml:mi mathvariant="italic">n</mml:mi> | |
241 | <mml:mo>+</mml:mo> | |
242 | <mml:mn>2</mml:mn> | |
243 | </mml:mrow> | |
244 | </mml:math> | |
245 | define triangle | |
246 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>. | |
247 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
248 | ||
249 | <mml:mrow> | |
250 | <mml:mi mathvariant="italic">N</mml:mi> | |
251 | <mml:mo>-</mml:mo> | |
252 | <mml:mn>2</mml:mn> | |
253 | </mml:mrow> | |
254 | </mml:math> | |
255 | triangles are drawn. | |
256 | </p></dd><dt><span class="term"><code class="constant">GL_QUADS</code></span></dt><dd><p> | |
257 | Treats each group of four vertices as an independent quadrilateral. | |
258 | Vertices | |
259 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
260 | ||
261 | <mml:mrow> | |
262 | <mml:mn>4</mml:mn> | |
263 | <mml:mo></mml:mo> | |
264 | <mml:mi mathvariant="italic">n</mml:mi> | |
265 | <mml:mo>-</mml:mo> | |
266 | <mml:mn>3</mml:mn> | |
267 | </mml:mrow> | |
268 | </mml:math>, | |
269 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
270 | ||
271 | <mml:mrow> | |
272 | <mml:mn>4</mml:mn> | |
273 | <mml:mo></mml:mo> | |
274 | <mml:mi mathvariant="italic">n</mml:mi> | |
275 | <mml:mo>-</mml:mo> | |
276 | <mml:mn>2</mml:mn> | |
277 | </mml:mrow> | |
278 | </mml:math>, | |
279 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
280 | ||
281 | <mml:mrow> | |
282 | <mml:mn>4</mml:mn> | |
283 | <mml:mo></mml:mo> | |
284 | <mml:mi mathvariant="italic">n</mml:mi> | |
285 | <mml:mo>-</mml:mo> | |
286 | <mml:mn>1</mml:mn> | |
287 | </mml:mrow> | |
288 | </mml:math>, | |
289 | and | |
290 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
291 | ||
292 | <mml:mrow> | |
293 | <mml:mn>4</mml:mn> | |
294 | <mml:mo></mml:mo> | |
295 | <mml:mi mathvariant="italic">n</mml:mi> | |
296 | </mml:mrow> | |
297 | </mml:math> | |
298 | define quadrilateral | |
299 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>. | |
300 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
301 | ||
302 | <mml:mfrac> | |
303 | <mml:mi mathvariant="italic">N</mml:mi> | |
304 | <mml:mn>4</mml:mn> | |
305 | </mml:mfrac> | |
306 | </mml:math> | |
307 | quadrilaterals are drawn. | |
308 | </p></dd><dt><span class="term"><code class="constant">GL_QUAD_STRIP</code></span></dt><dd><p> | |
309 | Draws a connected group of quadrilaterals. | |
310 | One quadrilateral is defined for each pair of vertices presented | |
311 | after the first pair. | |
312 | Vertices | |
313 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
314 | ||
315 | <mml:mrow> | |
316 | <mml:mn>2</mml:mn> | |
317 | <mml:mo></mml:mo> | |
318 | <mml:mi mathvariant="italic">n</mml:mi> | |
319 | <mml:mo>-</mml:mo> | |
320 | <mml:mn>1</mml:mn> | |
321 | </mml:mrow> | |
322 | </mml:math>, | |
323 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
324 | ||
325 | <mml:mrow> | |
326 | <mml:mn>2</mml:mn> | |
327 | <mml:mo></mml:mo> | |
328 | <mml:mi mathvariant="italic">n</mml:mi> | |
329 | </mml:mrow> | |
330 | </mml:math>, | |
331 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
332 | ||
333 | <mml:mrow> | |
334 | <mml:mn>2</mml:mn> | |
335 | <mml:mo></mml:mo> | |
336 | <mml:mi mathvariant="italic">n</mml:mi> | |
337 | <mml:mo>+</mml:mo> | |
338 | <mml:mn>2</mml:mn> | |
339 | </mml:mrow> | |
340 | </mml:math>, | |
341 | and | |
342 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
343 | ||
344 | <mml:mrow> | |
345 | <mml:mn>2</mml:mn> | |
346 | <mml:mo></mml:mo> | |
347 | <mml:mi mathvariant="italic">n</mml:mi> | |
348 | <mml:mo>+</mml:mo> | |
349 | <mml:mn>1</mml:mn> | |
350 | </mml:mrow> | |
351 | </mml:math> | |
352 | define quadrilateral | |
353 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>. | |
354 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
355 | ||
356 | <mml:mrow> | |
357 | <mml:mfrac> | |
358 | <mml:mi mathvariant="italic">N</mml:mi> | |
359 | <mml:mn>2</mml:mn> | |
360 | </mml:mfrac> | |
361 | <mml:mo>-</mml:mo> | |
362 | <mml:mn>1</mml:mn> | |
363 | </mml:mrow> | |
364 | </mml:math> | |
365 | quadrilaterals are drawn. | |
366 | Note that the order in which vertices are used to construct a quadrilateral | |
367 | from strip data is different from that used with independent data. | |
368 | </p></dd><dt><span class="term"><code class="constant">GL_POLYGON</code></span></dt><dd><p> | |
369 | Draws a single, | |
370 | convex polygon. | |
371 | Vertices | |
372 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
373 | ||
374 | <mml:mn>1</mml:mn> | |
375 | </mml:math> | |
376 | through | |
377 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">N</mml:mi></mml:math> | |
378 | define this polygon. | |
379 | </p></dd></dl></div><p> | |
380 | Only a subset of GL commands can be used between <code class="function">glBegin</code> and <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
381 | The commands are | |
382 | <a class="citerefentry" href="glVertex.xml"><span class="citerefentry"><span class="refentrytitle">glVertex</span></span></a>, | |
383 | <a class="citerefentry" href="glColor.xml"><span class="citerefentry"><span class="refentrytitle">glColor</span></span></a>, | |
384 | <a class="citerefentry" href="glSecondaryColor.xml"><span class="citerefentry"><span class="refentrytitle">glSecondaryColor</span></span></a>, | |
385 | <a class="citerefentry" href="glIndex.xml"><span class="citerefentry"><span class="refentrytitle">glIndex</span></span></a>, | |
386 | <a class="citerefentry" href="glNormal.xml"><span class="citerefentry"><span class="refentrytitle">glNormal</span></span></a>, | |
387 | <a class="citerefentry" href="glFogCoord.xml"><span class="citerefentry"><span class="refentrytitle">glFogCoord</span></span></a>, | |
388 | <a class="citerefentry" href="glTexCoord.xml"><span class="citerefentry"><span class="refentrytitle">glTexCoord</span></span></a>, | |
389 | <a class="citerefentry" href="glMultiTexCoord.xml"><span class="citerefentry"><span class="refentrytitle">glMultiTexCoord</span></span></a>, | |
390 | <a class="citerefentry" href="glVertexAttrib.xml"><span class="citerefentry"><span class="refentrytitle">glVertexAttrib</span></span></a>, | |
391 | <a class="citerefentry" href="glEvalCoord.xml"><span class="citerefentry"><span class="refentrytitle">glEvalCoord</span></span></a>, | |
392 | <a class="citerefentry" href="glEvalPoint.xml"><span class="citerefentry"><span class="refentrytitle">glEvalPoint</span></span></a>, | |
393 | <a class="citerefentry" href="glArrayElement.xml"><span class="citerefentry"><span class="refentrytitle">glArrayElement</span></span></a>, | |
394 | <a class="citerefentry" href="glMaterial.xml"><span class="citerefentry"><span class="refentrytitle">glMaterial</span></span></a>, and | |
395 | <a class="citerefentry" href="glEdgeFlag.xml"><span class="citerefentry"><span class="refentrytitle">glEdgeFlag</span></span></a>. | |
396 | Also, | |
397 | it is acceptable to use | |
398 | <a class="citerefentry" href="glCallList.xml"><span class="citerefentry"><span class="refentrytitle">glCallList</span></span></a> or | |
399 | <a class="citerefentry" href="glCallLists.xml"><span class="citerefentry"><span class="refentrytitle">glCallLists</span></span></a> to execute | |
400 | display lists that include only the preceding commands. | |
401 | If any other GL command is executed between <code class="function">glBegin</code> and <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>, | |
402 | the error flag is set and the command is ignored. | |
403 | </p><p> | |
404 | Regardless of the value chosen for <em class="parameter"><code>mode</code></em>, | |
405 | there is no limit to the number of vertices that can be defined | |
406 | between <code class="function">glBegin</code> and <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
407 | Lines, | |
408 | triangles, | |
409 | quadrilaterals, | |
410 | and polygons that are incompletely specified are not drawn. | |
411 | Incomplete specification results when either too few vertices are | |
412 | provided to specify even a single primitive or when an incorrect multiple | |
413 | of vertices is specified. The incomplete primitive is ignored; the rest are drawn. | |
414 | </p><p> | |
415 | The minimum specification of vertices | |
416 | for each primitive is as follows: | |
417 | 1 for a point, | |
418 | 2 for a line, | |
419 | 3 for a triangle, | |
420 | 4 for a quadrilateral, | |
421 | and 3 for a polygon. | |
422 | Modes that require a certain multiple of vertices are | |
423 | <code class="constant">GL_LINES</code> (2), | |
424 | <code class="constant">GL_TRIANGLES</code> (3), | |
425 | <code class="constant">GL_QUADS</code> (4), | |
426 | and <code class="constant">GL_QUAD_STRIP</code> (2). | |
427 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
428 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>mode</code></em> is set to an unaccepted value. | |
429 | </p><p> | |
430 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glBegin</code> is executed between a | |
431 | <code class="function">glBegin</code> | |
432 | and the corresponding execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
433 | </p><p> | |
434 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a> is executed without being | |
435 | preceded by a <code class="function">glBegin</code>. | |
436 | </p><p> | |
437 | <code class="constant">GL_INVALID_OPERATION</code> is generated if a command other than | |
438 | <a class="citerefentry" href="glVertex.xml"><span class="citerefentry"><span class="refentrytitle">glVertex</span></span></a>, | |
439 | <a class="citerefentry" href="glColor.xml"><span class="citerefentry"><span class="refentrytitle">glColor</span></span></a>, | |
440 | <a class="citerefentry" href="glSecondaryColor.xml"><span class="citerefentry"><span class="refentrytitle">glSecondaryColor</span></span></a>, | |
441 | <a class="citerefentry" href="glIndex.xml"><span class="citerefentry"><span class="refentrytitle">glIndex</span></span></a>, | |
442 | <a class="citerefentry" href="glNormal.xml"><span class="citerefentry"><span class="refentrytitle">glNormal</span></span></a>, | |
443 | <a class="citerefentry" href="glFogCoord.xml"><span class="citerefentry"><span class="refentrytitle">glFogCoord</span></span></a>, | |
444 | <a class="citerefentry" href="glTexCoord.xml"><span class="citerefentry"><span class="refentrytitle">glTexCoord</span></span></a>, | |
445 | <a class="citerefentry" href="glMultiTexCoord.xml"><span class="citerefentry"><span class="refentrytitle">glMultiTexCoord</span></span></a>, | |
446 | <a class="citerefentry" href="glVertexAttrib.xml"><span class="citerefentry"><span class="refentrytitle">glVertexAttrib</span></span></a>, | |
447 | <a class="citerefentry" href="glEvalCoord.xml"><span class="citerefentry"><span class="refentrytitle">glEvalCoord</span></span></a>, | |
448 | <a class="citerefentry" href="glEvalPoint.xml"><span class="citerefentry"><span class="refentrytitle">glEvalPoint</span></span></a>, | |
449 | <a class="citerefentry" href="glArrayElement.xml"><span class="citerefentry"><span class="refentrytitle">glArrayElement</span></span></a>, | |
450 | <a class="citerefentry" href="glMaterial.xml"><span class="citerefentry"><span class="refentrytitle">glMaterial</span></span></a>, | |
451 | <a class="citerefentry" href="glEdgeFlag.xml"><span class="citerefentry"><span class="refentrytitle">glEdgeFlag</span></span></a>, | |
452 | <a class="citerefentry" href="glCallList.xml"><span class="citerefentry"><span class="refentrytitle">glCallList</span></span></a>, or | |
453 | <a class="citerefentry" href="glCallLists.xml"><span class="citerefentry"><span class="refentrytitle">glCallLists</span></span></a> is executed between | |
454 | the execution of <code class="function">glBegin</code> and the corresponding | |
455 | execution <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
456 | </p><p> | |
457 | Execution of | |
458 | <a class="citerefentry" href="glEnableClientState.xml"><span class="citerefentry"><span class="refentrytitle">glEnableClientState</span></span></a>, | |
459 | <a class="citerefentry" href="glDisableClientState.xml"><span class="citerefentry"><span class="refentrytitle">glDisableClientState</span></span></a>, | |
460 | <a class="citerefentry" href="glEdgeFlagPointer.xml"><span class="citerefentry"><span class="refentrytitle">glEdgeFlagPointer</span></span></a>, | |
461 | <a class="citerefentry" href="glFogCoordPointer.xml"><span class="citerefentry"><span class="refentrytitle">glFogCoordPointer</span></span></a>, | |
462 | <a class="citerefentry" href="glTexCoordPointer.xml"><span class="citerefentry"><span class="refentrytitle">glTexCoordPointer</span></span></a>, | |
463 | <a class="citerefentry" href="glColorPointer.xml"><span class="citerefentry"><span class="refentrytitle">glColorPointer</span></span></a>, | |
464 | <a class="citerefentry" href="glSecondaryColorPointer.xml"><span class="citerefentry"><span class="refentrytitle">glSecondaryColorPointer</span></span></a>, | |
465 | <a class="citerefentry" href="glIndexPointer.xml"><span class="citerefentry"><span class="refentrytitle">glIndexPointer</span></span></a>, | |
466 | <a class="citerefentry" href="glNormalPointer.xml"><span class="citerefentry"><span class="refentrytitle">glNormalPointer</span></span></a>, | |
467 | <a class="citerefentry" href="glVertexPointer.xml"><span class="citerefentry"><span class="refentrytitle">glVertexPointer</span></span></a>, | |
468 | <a class="citerefentry" href="glVertexAttribPointer.xml"><span class="citerefentry"><span class="refentrytitle">glVertexAttribPointer</span></span></a>, | |
469 | <a class="citerefentry" href="glInterleavedArrays.xml"><span class="citerefentry"><span class="refentrytitle">glInterleavedArrays</span></span></a>, or | |
470 | <a class="citerefentry" href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a> is not allowed after a call to <code class="function">glBegin</code> and before | |
471 | the corresponding call to <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>, | |
472 | but an error may or may not be generated. | |
473 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
474 | <a class="citerefentry" href="glArrayElement.xml"><span class="citerefentry"><span class="refentrytitle">glArrayElement</span></span></a>, | |
475 | <a class="citerefentry" href="glCallList.xml"><span class="citerefentry"><span class="refentrytitle">glCallList</span></span></a>, | |
476 | <a class="citerefentry" href="glCallLists.xml"><span class="citerefentry"><span class="refentrytitle">glCallLists</span></span></a>, | |
477 | <a class="citerefentry" href="glColor.xml"><span class="citerefentry"><span class="refentrytitle">glColor</span></span></a>, | |
478 | <a class="citerefentry" href="glEdgeFlag.xml"><span class="citerefentry"><span class="refentrytitle">glEdgeFlag</span></span></a>, | |
479 | <a class="citerefentry" href="glEvalCoord.xml"><span class="citerefentry"><span class="refentrytitle">glEvalCoord</span></span></a>, | |
480 | <a class="citerefentry" href="glEvalPoint.xml"><span class="citerefentry"><span class="refentrytitle">glEvalPoint</span></span></a>, | |
481 | <a class="citerefentry" href="glFogCoord.xml"><span class="citerefentry"><span class="refentrytitle">glFogCoord</span></span></a>, | |
482 | <a class="citerefentry" href="glIndex.xml"><span class="citerefentry"><span class="refentrytitle">glIndex</span></span></a>, | |
483 | <a class="citerefentry" href="glMaterial.xml"><span class="citerefentry"><span class="refentrytitle">glMaterial</span></span></a>, | |
484 | <a class="citerefentry" href="glMultiTexCoord.xml"><span class="citerefentry"><span class="refentrytitle">glMultiTexCoord</span></span></a>, | |
485 | <a class="citerefentry" href="glNormal.xml"><span class="citerefentry"><span class="refentrytitle">glNormal</span></span></a>, | |
486 | <a class="citerefentry" href="glSecondaryColor.xml"><span class="citerefentry"><span class="refentrytitle">glSecondaryColor</span></span></a>, | |
487 | <a class="citerefentry" href="glTexCoord.xml"><span class="citerefentry"><span class="refentrytitle">glTexCoord</span></span></a>, | |
488 | <a class="citerefentry" href="glVertex.xml"><span class="citerefentry"><span class="refentrytitle">glVertex</span></span></a>, | |
489 | <a class="citerefentry" href="glVertexAttrib.xml"><span class="citerefentry"><span class="refentrytitle">glVertexAttrib</span></span></a> | |
490 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
491 | Copyright <span class="trademark"></span>© 1991-2006 | |
492 | Silicon Graphics, Inc. This document is licensed under the SGI | |
493 | Free Software B License. For details, see | |
494 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
495 | </p></div></div></body></html> |