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="glBegin"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>1991-2006</year> | |
9 | <holder>Silicon Graphics, Inc.</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glBegin</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glBegin</refname> | |
17 | <refpurpose>delimit the vertices of a primitive or a group of like primitives</refpurpose> | |
18 | </refnamediv> | |
19 | <refsynopsisdiv><title>C Specification</title> | |
20 | <funcsynopsis> | |
21 | <funcprototype> | |
22 | <funcdef>void <function>glBegin</function></funcdef> | |
23 | <paramdef>GLenum <parameter>mode</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>mode</parameter></term> | |
32 | <listitem> | |
33 | <para> | |
34 | Specifies the primitive or primitives that will be created from vertices | |
35 | presented between <function>glBegin</function> and the subsequent <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>. | |
36 | Ten symbolic constants are accepted: | |
37 | <constant>GL_POINTS</constant>, | |
38 | <constant>GL_LINES</constant>, | |
39 | <constant>GL_LINE_STRIP</constant>, | |
40 | <constant>GL_LINE_LOOP</constant>, | |
41 | <constant>GL_TRIANGLES</constant>, | |
42 | <constant>GL_TRIANGLE_STRIP</constant>, | |
43 | <constant>GL_TRIANGLE_FAN</constant>, | |
44 | <constant>GL_QUADS</constant>, | |
45 | <constant>GL_QUAD_STRIP</constant>, and | |
46 | <constant>GL_POLYGON</constant>. | |
47 | </para> | |
48 | </listitem> | |
49 | </varlistentry> | |
50 | </variablelist> | |
51 | </refsect1> | |
52 | <refsynopsisdiv><title>C Specification</title> | |
53 | <funcsynopsis> | |
54 | <funcprototype> | |
55 | <funcdef>void <function>glEnd</function></funcdef> | |
56 | <paramdef><parameter>void</parameter></paramdef> | |
57 | </funcprototype> | |
58 | </funcsynopsis> | |
59 | </refsynopsisdiv> | |
60 | <refsect1 id="description"><title>Description</title> | |
61 | <para> | |
62 | <function>glBegin</function> and <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry> delimit the vertices that define a primitive or | |
63 | a group of like primitives. | |
64 | <function>glBegin</function> accepts a single argument that specifies in which of ten ways the | |
65 | vertices are interpreted. | |
66 | Taking | |
67 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation> | |
68 | as an integer count starting at one, | |
69 | and | |
70 | <inlineequation><mml:math><mml:mi mathvariant="italic">N</mml:mi></mml:math></inlineequation> | |
71 | as the total number of vertices specified, | |
72 | the interpretations are as follows: | |
73 | </para> | |
74 | <variablelist> | |
75 | <varlistentry> | |
76 | <term><constant>GL_POINTS</constant></term> | |
77 | <listitem> | |
78 | <para> | |
79 | Treats each vertex as a single point. | |
80 | Vertex | |
81 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation> | |
82 | defines point | |
83 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>. | |
84 | <inlineequation><mml:math><mml:mi mathvariant="italic">N</mml:mi></mml:math></inlineequation> | |
85 | points are drawn. | |
86 | </para> | |
87 | </listitem> | |
88 | </varlistentry> | |
89 | <varlistentry> | |
90 | <term><constant>GL_LINES</constant></term> | |
91 | <listitem> | |
92 | <para> | |
93 | Treats each pair of vertices as an independent line segment. | |
94 | Vertices | |
95 | <inlineequation><mml:math> | |
96 | <!-- eqn: 2n - 1:--> | |
97 | <mml:mrow> | |
98 | <mml:mn>2</mml:mn> | |
99 | <mml:mo>⁢</mml:mo> | |
100 | <mml:mi mathvariant="italic">n</mml:mi> | |
101 | <mml:mo>-</mml:mo> | |
102 | <mml:mn>1</mml:mn> | |
103 | </mml:mrow> | |
104 | </mml:math></inlineequation> | |
105 | and | |
106 | <inlineequation><mml:math> | |
107 | <!-- eqn: 2n:--> | |
108 | <mml:mrow> | |
109 | <mml:mn>2</mml:mn> | |
110 | <mml:mo>⁢</mml:mo> | |
111 | <mml:mi mathvariant="italic">n</mml:mi> | |
112 | </mml:mrow> | |
113 | </mml:math></inlineequation> | |
114 | define line | |
115 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>. | |
116 | <inlineequation><mml:math> | |
117 | <!-- eqn: N/2:--> | |
118 | <mml:mfrac> | |
119 | <mml:mi mathvariant="italic">N</mml:mi> | |
120 | <mml:mn>2</mml:mn> | |
121 | </mml:mfrac> | |
122 | </mml:math></inlineequation> | |
123 | lines are drawn. | |
124 | </para> | |
125 | </listitem> | |
126 | </varlistentry> | |
127 | <varlistentry> | |
128 | <term><constant>GL_LINE_STRIP</constant></term> | |
129 | <listitem> | |
130 | <para> | |
131 | Draws a connected group of line segments from the first vertex | |
132 | to the last. | |
133 | Vertices | |
134 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation> | |
135 | and | |
136 | <inlineequation><mml:math> | |
137 | <!-- eqn: n + 1:--> | |
138 | <mml:mrow> | |
139 | <mml:mi mathvariant="italic">n</mml:mi> | |
140 | <mml:mo>+</mml:mo> | |
141 | <mml:mn>1</mml:mn> | |
142 | </mml:mrow> | |
143 | </mml:math></inlineequation> | |
144 | define line | |
145 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>. | |
146 | <inlineequation><mml:math> | |
147 | <!-- eqn: N - 1:--> | |
148 | <mml:mrow> | |
149 | <mml:mi mathvariant="italic">N</mml:mi> | |
150 | <mml:mo>-</mml:mo> | |
151 | <mml:mn>1</mml:mn> | |
152 | </mml:mrow> | |
153 | </mml:math></inlineequation> | |
154 | lines are drawn. | |
155 | </para> | |
156 | </listitem> | |
157 | </varlistentry> | |
158 | <varlistentry> | |
159 | <term><constant>GL_LINE_LOOP</constant></term> | |
160 | <listitem> | |
161 | <para> | |
162 | Draws a connected group of line segments from the first vertex | |
163 | to the last, | |
164 | then back to the first. | |
165 | Vertices | |
166 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation> | |
167 | and | |
168 | <inlineequation><mml:math> | |
169 | <!-- eqn: n + 1:--> | |
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></inlineequation> | |
176 | define line | |
177 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>. | |
178 | The last line, however, is defined by vertices | |
179 | <inlineequation><mml:math><mml:mi mathvariant="italic">N</mml:mi></mml:math></inlineequation> | |
180 | and | |
181 | <inlineequation><mml:math> | |
182 | <!-- eqn: 1:--> | |
183 | <mml:mn>1</mml:mn> | |
184 | </mml:math></inlineequation>. | |
185 | <inlineequation><mml:math><mml:mi mathvariant="italic">N</mml:mi></mml:math></inlineequation> | |
186 | lines are drawn. | |
187 | </para> | |
188 | </listitem> | |
189 | </varlistentry> | |
190 | <varlistentry> | |
191 | <term><constant>GL_TRIANGLES</constant></term> | |
192 | <listitem> | |
193 | <para> | |
194 | Treats each triplet of vertices as an independent triangle. | |
195 | Vertices | |
196 | <inlineequation><mml:math> | |
197 | <!-- eqn: 3n - 2:--> | |
198 | <mml:mrow> | |
199 | <mml:mn>3</mml:mn> | |
200 | <mml:mo>⁢</mml:mo> | |
201 | <mml:mi mathvariant="italic">n</mml:mi> | |
202 | <mml:mo>-</mml:mo> | |
203 | <mml:mn>2</mml:mn> | |
204 | </mml:mrow> | |
205 | </mml:math></inlineequation>, | |
206 | <inlineequation><mml:math> | |
207 | <!-- eqn: 3n - 1:--> | |
208 | <mml:mrow> | |
209 | <mml:mn>3</mml:mn> | |
210 | <mml:mo>⁢</mml:mo> | |
211 | <mml:mi mathvariant="italic">n</mml:mi> | |
212 | <mml:mo>-</mml:mo> | |
213 | <mml:mn>1</mml:mn> | |
214 | </mml:mrow> | |
215 | </mml:math></inlineequation>, | |
216 | and | |
217 | <inlineequation><mml:math> | |
218 | <!-- eqn: 3n:--> | |
219 | <mml:mrow> | |
220 | <mml:mn>3</mml:mn> | |
221 | <mml:mo>⁢</mml:mo> | |
222 | <mml:mi mathvariant="italic">n</mml:mi> | |
223 | </mml:mrow> | |
224 | </mml:math></inlineequation> | |
225 | define triangle | |
226 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>. | |
227 | <inlineequation><mml:math> | |
228 | <!-- eqn: N/3:--> | |
229 | <mml:mfrac> | |
230 | <mml:mi mathvariant="italic">N</mml:mi> | |
231 | <mml:mn>3</mml:mn> | |
232 | </mml:mfrac> | |
233 | </mml:math></inlineequation> | |
234 | triangles are drawn. | |
235 | </para> | |
236 | </listitem> | |
237 | </varlistentry> | |
238 | <varlistentry> | |
239 | <term><constant>GL_TRIANGLE_STRIP</constant></term> | |
240 | <listitem> | |
241 | <para> | |
242 | Draws a connected group of triangles. One triangle is defined for each | |
243 | vertex presented after the first two vertices. For odd | |
244 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>, | |
245 | vertices | |
246 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>, | |
247 | <inlineequation><mml:math> | |
248 | <!-- eqn: n + 1:--> | |
249 | <mml:mrow> | |
250 | <mml:mi mathvariant="italic">n</mml:mi> | |
251 | <mml:mo>+</mml:mo> | |
252 | <mml:mn>1</mml:mn> | |
253 | </mml:mrow> | |
254 | </mml:math></inlineequation>, | |
255 | and | |
256 | <inlineequation><mml:math> | |
257 | <!-- eqn: n + 2:--> | |
258 | <mml:mrow> | |
259 | <mml:mi mathvariant="italic">n</mml:mi> | |
260 | <mml:mo>+</mml:mo> | |
261 | <mml:mn>2</mml:mn> | |
262 | </mml:mrow> | |
263 | </mml:math></inlineequation> | |
264 | define triangle | |
265 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>. | |
266 | For even | |
267 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>, | |
268 | vertices | |
269 | <inlineequation><mml:math> | |
270 | <!-- eqn: n + 1:--> | |
271 | <mml:mrow> | |
272 | <mml:mi mathvariant="italic">n</mml:mi> | |
273 | <mml:mo>+</mml:mo> | |
274 | <mml:mn>1</mml:mn> | |
275 | </mml:mrow> | |
276 | </mml:math></inlineequation>, | |
277 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>, | |
278 | and | |
279 | <inlineequation><mml:math> | |
280 | <!-- eqn: n + 2:--> | |
281 | <mml:mrow> | |
282 | <mml:mi mathvariant="italic">n</mml:mi> | |
283 | <mml:mo>+</mml:mo> | |
284 | <mml:mn>2</mml:mn> | |
285 | </mml:mrow> | |
286 | </mml:math></inlineequation> | |
287 | define triangle | |
288 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>. | |
289 | <inlineequation><mml:math> | |
290 | <!-- eqn: N - 2:--> | |
291 | <mml:mrow> | |
292 | <mml:mi mathvariant="italic">N</mml:mi> | |
293 | <mml:mo>-</mml:mo> | |
294 | <mml:mn>2</mml:mn> | |
295 | </mml:mrow> | |
296 | </mml:math></inlineequation> | |
297 | triangles are | |
298 | drawn. | |
299 | </para> | |
300 | </listitem> | |
301 | </varlistentry> | |
302 | <varlistentry> | |
303 | <term><constant>GL_TRIANGLE_FAN</constant></term> | |
304 | <listitem> | |
305 | <para> | |
306 | Draws a connected group of triangles. | |
307 | One triangle is defined for each vertex presented after the first two vertices. | |
308 | Vertices | |
309 | <inlineequation><mml:math> | |
310 | <!-- eqn: 1:--> | |
311 | <mml:mn>1</mml:mn> | |
312 | </mml:math></inlineequation>, | |
313 | <inlineequation><mml:math> | |
314 | <!-- eqn: n + 1:--> | |
315 | <mml:mrow> | |
316 | <mml:mi mathvariant="italic">n</mml:mi> | |
317 | <mml:mo>+</mml:mo> | |
318 | <mml:mn>1</mml:mn> | |
319 | </mml:mrow> | |
320 | </mml:math></inlineequation>, | |
321 | and | |
322 | <inlineequation><mml:math> | |
323 | <!-- eqn: n + 2:--> | |
324 | <mml:mrow> | |
325 | <mml:mi mathvariant="italic">n</mml:mi> | |
326 | <mml:mo>+</mml:mo> | |
327 | <mml:mn>2</mml:mn> | |
328 | </mml:mrow> | |
329 | </mml:math></inlineequation> | |
330 | define triangle | |
331 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>. | |
332 | <inlineequation><mml:math> | |
333 | <!-- eqn: N - 2:--> | |
334 | <mml:mrow> | |
335 | <mml:mi mathvariant="italic">N</mml:mi> | |
336 | <mml:mo>-</mml:mo> | |
337 | <mml:mn>2</mml:mn> | |
338 | </mml:mrow> | |
339 | </mml:math></inlineequation> | |
340 | triangles are drawn. | |
341 | </para> | |
342 | </listitem> | |
343 | </varlistentry> | |
344 | <varlistentry> | |
345 | <term><constant>GL_QUADS</constant></term> | |
346 | <listitem> | |
347 | <para> | |
348 | Treats each group of four vertices as an independent quadrilateral. | |
349 | Vertices | |
350 | <inlineequation><mml:math> | |
351 | <!-- eqn: 4n - 3:--> | |
352 | <mml:mrow> | |
353 | <mml:mn>4</mml:mn> | |
354 | <mml:mo>⁢</mml:mo> | |
355 | <mml:mi mathvariant="italic">n</mml:mi> | |
356 | <mml:mo>-</mml:mo> | |
357 | <mml:mn>3</mml:mn> | |
358 | </mml:mrow> | |
359 | </mml:math></inlineequation>, | |
360 | <inlineequation><mml:math> | |
361 | <!-- eqn: 4n - 2:--> | |
362 | <mml:mrow> | |
363 | <mml:mn>4</mml:mn> | |
364 | <mml:mo>⁢</mml:mo> | |
365 | <mml:mi mathvariant="italic">n</mml:mi> | |
366 | <mml:mo>-</mml:mo> | |
367 | <mml:mn>2</mml:mn> | |
368 | </mml:mrow> | |
369 | </mml:math></inlineequation>, | |
370 | <inlineequation><mml:math> | |
371 | <!-- eqn: 4n - 1:--> | |
372 | <mml:mrow> | |
373 | <mml:mn>4</mml:mn> | |
374 | <mml:mo>⁢</mml:mo> | |
375 | <mml:mi mathvariant="italic">n</mml:mi> | |
376 | <mml:mo>-</mml:mo> | |
377 | <mml:mn>1</mml:mn> | |
378 | </mml:mrow> | |
379 | </mml:math></inlineequation>, | |
380 | and | |
381 | <inlineequation><mml:math> | |
382 | <!-- eqn: 4n:--> | |
383 | <mml:mrow> | |
384 | <mml:mn>4</mml:mn> | |
385 | <mml:mo>⁢</mml:mo> | |
386 | <mml:mi mathvariant="italic">n</mml:mi> | |
387 | </mml:mrow> | |
388 | </mml:math></inlineequation> | |
389 | define quadrilateral | |
390 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>. | |
391 | <inlineequation><mml:math> | |
392 | <!-- eqn: N/4:--> | |
393 | <mml:mfrac> | |
394 | <mml:mi mathvariant="italic">N</mml:mi> | |
395 | <mml:mn>4</mml:mn> | |
396 | </mml:mfrac> | |
397 | </mml:math></inlineequation> | |
398 | quadrilaterals are drawn. | |
399 | </para> | |
400 | </listitem> | |
401 | </varlistentry> | |
402 | <varlistentry> | |
403 | <term><constant>GL_QUAD_STRIP</constant></term> | |
404 | <listitem> | |
405 | <para> | |
406 | Draws a connected group of quadrilaterals. | |
407 | One quadrilateral is defined for each pair of vertices presented | |
408 | after the first pair. | |
409 | Vertices | |
410 | <inlineequation><mml:math> | |
411 | <!-- eqn: 2n - 1:--> | |
412 | <mml:mrow> | |
413 | <mml:mn>2</mml:mn> | |
414 | <mml:mo>⁢</mml:mo> | |
415 | <mml:mi mathvariant="italic">n</mml:mi> | |
416 | <mml:mo>-</mml:mo> | |
417 | <mml:mn>1</mml:mn> | |
418 | </mml:mrow> | |
419 | </mml:math></inlineequation>, | |
420 | <inlineequation><mml:math> | |
421 | <!-- eqn: 2n:--> | |
422 | <mml:mrow> | |
423 | <mml:mn>2</mml:mn> | |
424 | <mml:mo>⁢</mml:mo> | |
425 | <mml:mi mathvariant="italic">n</mml:mi> | |
426 | </mml:mrow> | |
427 | </mml:math></inlineequation>, | |
428 | <inlineequation><mml:math> | |
429 | <!-- eqn: 2n + 2:--> | |
430 | <mml:mrow> | |
431 | <mml:mn>2</mml:mn> | |
432 | <mml:mo>⁢</mml:mo> | |
433 | <mml:mi mathvariant="italic">n</mml:mi> | |
434 | <mml:mo>+</mml:mo> | |
435 | <mml:mn>2</mml:mn> | |
436 | </mml:mrow> | |
437 | </mml:math></inlineequation>, | |
438 | and | |
439 | <inlineequation><mml:math> | |
440 | <!-- eqn: 2n + 1:--> | |
441 | <mml:mrow> | |
442 | <mml:mn>2</mml:mn> | |
443 | <mml:mo>⁢</mml:mo> | |
444 | <mml:mi mathvariant="italic">n</mml:mi> | |
445 | <mml:mo>+</mml:mo> | |
446 | <mml:mn>1</mml:mn> | |
447 | </mml:mrow> | |
448 | </mml:math></inlineequation> | |
449 | define quadrilateral | |
450 | <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>. | |
451 | <inlineequation><mml:math> | |
452 | <!-- eqn: N/2 - 1:--> | |
453 | <mml:mrow> | |
454 | <mml:mfrac> | |
455 | <mml:mi mathvariant="italic">N</mml:mi> | |
456 | <mml:mn>2</mml:mn> | |
457 | </mml:mfrac> | |
458 | <mml:mo>-</mml:mo> | |
459 | <mml:mn>1</mml:mn> | |
460 | </mml:mrow> | |
461 | </mml:math></inlineequation> | |
462 | quadrilaterals are drawn. | |
463 | Note that the order in which vertices are used to construct a quadrilateral | |
464 | from strip data is different from that used with independent data. | |
465 | </para> | |
466 | </listitem> | |
467 | </varlistentry> | |
468 | <varlistentry> | |
469 | <term><constant>GL_POLYGON</constant></term> | |
470 | <listitem> | |
471 | <para> | |
472 | Draws a single, | |
473 | convex polygon. | |
474 | Vertices | |
475 | <inlineequation><mml:math> | |
476 | <!-- eqn: 1:--> | |
477 | <mml:mn>1</mml:mn> | |
478 | </mml:math></inlineequation> | |
479 | through | |
480 | <inlineequation><mml:math><mml:mi mathvariant="italic">N</mml:mi></mml:math></inlineequation> | |
481 | define this polygon. | |
482 | </para> | |
483 | </listitem> | |
484 | </varlistentry> | |
485 | </variablelist> | |
486 | <para> | |
487 | Only a subset of GL commands can be used between <function>glBegin</function> and <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>. | |
488 | The commands are | |
489 | <citerefentry><refentrytitle>glVertex</refentrytitle></citerefentry>, | |
490 | <citerefentry><refentrytitle>glColor</refentrytitle></citerefentry>, | |
491 | <citerefentry><refentrytitle>glSecondaryColor</refentrytitle></citerefentry>, | |
492 | <citerefentry><refentrytitle>glIndex</refentrytitle></citerefentry>, | |
493 | <citerefentry><refentrytitle>glNormal</refentrytitle></citerefentry>, | |
494 | <citerefentry><refentrytitle>glFogCoord</refentrytitle></citerefentry>, | |
495 | <citerefentry><refentrytitle>glTexCoord</refentrytitle></citerefentry>, | |
496 | <citerefentry><refentrytitle>glMultiTexCoord</refentrytitle></citerefentry>, | |
497 | <citerefentry><refentrytitle>glVertexAttrib</refentrytitle></citerefentry>, | |
498 | <citerefentry><refentrytitle>glEvalCoord</refentrytitle></citerefentry>, | |
499 | <citerefentry><refentrytitle>glEvalPoint</refentrytitle></citerefentry>, | |
500 | <citerefentry><refentrytitle>glArrayElement</refentrytitle></citerefentry>, | |
501 | <citerefentry><refentrytitle>glMaterial</refentrytitle></citerefentry>, and | |
502 | <citerefentry><refentrytitle>glEdgeFlag</refentrytitle></citerefentry>. | |
503 | Also, | |
504 | it is acceptable to use | |
505 | <citerefentry><refentrytitle>glCallList</refentrytitle></citerefentry> or | |
506 | <citerefentry><refentrytitle>glCallLists</refentrytitle></citerefentry> to execute | |
507 | display lists that include only the preceding commands. | |
508 | If any other GL command is executed between <function>glBegin</function> and <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>, | |
509 | the error flag is set and the command is ignored. | |
510 | </para> | |
511 | <para> | |
512 | Regardless of the value chosen for <parameter>mode</parameter>, | |
513 | there is no limit to the number of vertices that can be defined | |
514 | between <function>glBegin</function> and <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>. | |
515 | Lines, | |
516 | triangles, | |
517 | quadrilaterals, | |
518 | and polygons that are incompletely specified are not drawn. | |
519 | Incomplete specification results when either too few vertices are | |
520 | provided to specify even a single primitive or when an incorrect multiple | |
521 | of vertices is specified. The incomplete primitive is ignored; the rest are drawn. | |
522 | </para> | |
523 | <para> | |
524 | The minimum specification of vertices | |
525 | for each primitive is as follows: | |
526 | 1 for a point, | |
527 | 2 for a line, | |
528 | 3 for a triangle, | |
529 | 4 for a quadrilateral, | |
530 | and 3 for a polygon. | |
531 | Modes that require a certain multiple of vertices are | |
532 | <constant>GL_LINES</constant> (2), | |
533 | <constant>GL_TRIANGLES</constant> (3), | |
534 | <constant>GL_QUADS</constant> (4), | |
535 | and <constant>GL_QUAD_STRIP</constant> (2). | |
536 | </para> | |
537 | </refsect1> | |
538 | <refsect1 id="errors"><title>Errors</title> | |
539 | <para> | |
540 | <constant>GL_INVALID_ENUM</constant> is generated if <parameter>mode</parameter> is set to an unaccepted value. | |
541 | </para> | |
542 | <para> | |
543 | <constant>GL_INVALID_OPERATION</constant> is generated if <function>glBegin</function> is executed between a | |
544 | <function>glBegin</function> | |
545 | and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>. | |
546 | </para> | |
547 | <para> | |
548 | <constant>GL_INVALID_OPERATION</constant> is generated if <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry> is executed without being | |
549 | preceded by a <function>glBegin</function>. | |
550 | </para> | |
551 | <para> | |
552 | <constant>GL_INVALID_OPERATION</constant> is generated if a command other than | |
553 | <citerefentry><refentrytitle>glVertex</refentrytitle></citerefentry>, | |
554 | <citerefentry><refentrytitle>glColor</refentrytitle></citerefentry>, | |
555 | <citerefentry><refentrytitle>glSecondaryColor</refentrytitle></citerefentry>, | |
556 | <citerefentry><refentrytitle>glIndex</refentrytitle></citerefentry>, | |
557 | <citerefentry><refentrytitle>glNormal</refentrytitle></citerefentry>, | |
558 | <citerefentry><refentrytitle>glFogCoord</refentrytitle></citerefentry>, | |
559 | <citerefentry><refentrytitle>glTexCoord</refentrytitle></citerefentry>, | |
560 | <citerefentry><refentrytitle>glMultiTexCoord</refentrytitle></citerefentry>, | |
561 | <citerefentry><refentrytitle>glVertexAttrib</refentrytitle></citerefentry>, | |
562 | <citerefentry><refentrytitle>glEvalCoord</refentrytitle></citerefentry>, | |
563 | <citerefentry><refentrytitle>glEvalPoint</refentrytitle></citerefentry>, | |
564 | <citerefentry><refentrytitle>glArrayElement</refentrytitle></citerefentry>, | |
565 | <citerefentry><refentrytitle>glMaterial</refentrytitle></citerefentry>, | |
566 | <citerefentry><refentrytitle>glEdgeFlag</refentrytitle></citerefentry>, | |
567 | <citerefentry><refentrytitle>glCallList</refentrytitle></citerefentry>, or | |
568 | <citerefentry><refentrytitle>glCallLists</refentrytitle></citerefentry> is executed between | |
569 | the execution of <function>glBegin</function> and the corresponding | |
570 | execution <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>. | |
571 | </para> | |
572 | <para> | |
573 | Execution of | |
574 | <citerefentry><refentrytitle>glEnableClientState</refentrytitle></citerefentry>, | |
575 | <citerefentry><refentrytitle>glDisableClientState</refentrytitle></citerefentry>, | |
576 | <citerefentry><refentrytitle>glEdgeFlagPointer</refentrytitle></citerefentry>, | |
577 | <citerefentry><refentrytitle>glFogCoordPointer</refentrytitle></citerefentry>, | |
578 | <citerefentry><refentrytitle>glTexCoordPointer</refentrytitle></citerefentry>, | |
579 | <citerefentry><refentrytitle>glColorPointer</refentrytitle></citerefentry>, | |
580 | <citerefentry><refentrytitle>glSecondaryColorPointer</refentrytitle></citerefentry>, | |
581 | <citerefentry><refentrytitle>glIndexPointer</refentrytitle></citerefentry>, | |
582 | <citerefentry><refentrytitle>glNormalPointer</refentrytitle></citerefentry>, | |
583 | <citerefentry><refentrytitle>glVertexPointer</refentrytitle></citerefentry>, | |
584 | <citerefentry><refentrytitle>glVertexAttribPointer</refentrytitle></citerefentry>, | |
585 | <citerefentry><refentrytitle>glInterleavedArrays</refentrytitle></citerefentry>, or | |
586 | <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry> is not allowed after a call to <function>glBegin</function> and before | |
587 | the corresponding call to <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>, | |
588 | but an error may or may not be generated. | |
589 | </para> | |
590 | </refsect1> | |
591 | <refsect1 id="seealso"><title>See Also</title> | |
592 | <para> | |
593 | <citerefentry><refentrytitle>glArrayElement</refentrytitle></citerefentry>, | |
594 | <citerefentry><refentrytitle>glCallList</refentrytitle></citerefentry>, | |
595 | <citerefentry><refentrytitle>glCallLists</refentrytitle></citerefentry>, | |
596 | <citerefentry><refentrytitle>glColor</refentrytitle></citerefentry>, | |
597 | <citerefentry><refentrytitle>glEdgeFlag</refentrytitle></citerefentry>, | |
598 | <citerefentry><refentrytitle>glEvalCoord</refentrytitle></citerefentry>, | |
599 | <citerefentry><refentrytitle>glEvalPoint</refentrytitle></citerefentry>, | |
600 | <citerefentry><refentrytitle>glFogCoord</refentrytitle></citerefentry>, | |
601 | <citerefentry><refentrytitle>glIndex</refentrytitle></citerefentry>, | |
602 | <citerefentry><refentrytitle>glMaterial</refentrytitle></citerefentry>, | |
603 | <citerefentry><refentrytitle>glMultiTexCoord</refentrytitle></citerefentry>, | |
604 | <citerefentry><refentrytitle>glNormal</refentrytitle></citerefentry>, | |
605 | <citerefentry><refentrytitle>glSecondaryColor</refentrytitle></citerefentry>, | |
606 | <citerefentry><refentrytitle>glTexCoord</refentrytitle></citerefentry>, | |
607 | <citerefentry><refentrytitle>glVertex</refentrytitle></citerefentry>, | |
608 | <citerefentry><refentrytitle>glVertexAttrib</refentrytitle></citerefentry> | |
609 | </para> | |
610 | </refsect1> | |
611 | <refsect1 id="Copyright"><title>Copyright</title> | |
612 | <para> | |
613 | Copyright <trademark class="copyright"></trademark> 1991-2006 | |
614 | Silicon Graphics, Inc. This document is licensed under the SGI | |
615 | Free Software B License. For details, see | |
616 | <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>. | |
617 | </para> | |
618 | </refsect1> | |
619 | </refentry> |