File: begin.3gl

package info (click to toggle)
vnc4 4.1.1%2BX4.3.0-37
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 171,636 kB
  • ctags: 288,245
  • sloc: ansic: 2,205,268; cpp: 56,345; sh: 38,092; pascal: 13,773; asm: 12,656; tcl: 9,182; lisp: 7,831; perl: 3,364; makefile: 2,957; yacc: 2,902; objc: 2,698; xml: 2,614; python: 2,383; lex: 1,477; awk: 901; csh: 58; sed: 50
file content (217 lines) | stat: -rw-r--r-- 6,228 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
'\" te
'\"! tbl|eqn | mmdoc
'\"macro stdmacro
.ds Vn Version 1.2
.ds Dt 24 September 1999
.ds Re Release 1.2.1
.ds Dp Jan 14 18:30
.ds Dm 01 begin.gl 
.ds Xs 5437 8 begin.gl
.TH GLBEGIN 3G
.SH NAME
.B "glBegin, glEnd
\- delimit the vertices of a primitive or a group of like primitives

.SH C SPECIFICATION
void \f3glBegin\fP(
GLenum \fImode\fP )
.nf
.fi

.EQ
delim $$
.EN
.SH PARAMETERS
.TP \w'\f2mode\fP\ \ 'u 
\f2mode\fP
Specifies the primitive or primitives that will be created from vertices
presented between \%\f3glBegin\fP and the subsequent \%\f3glEnd\fP.
Ten symbolic constants are accepted:
\%\f3GL_POINTS\fP,
\%\f3GL_LINES\fP,
\%\f3GL_LINE_STRIP\fP,
\%\f3GL_LINE_LOOP\fP,
\%\f3GL_TRIANGLES\fP,
\%\f3GL_TRIANGLE_STRIP\fP,
\%\f3GL_TRIANGLE_FAN\fP,
\%\f3GL_QUADS\fP,
\%\f3GL_QUAD_STRIP\fP, and
\%\f3GL_POLYGON\fP.
.SH C SPECIFICATION
void \f3glEnd\fP( void )
.nf
.fi

.SH DESCRIPTION
\%\f3glBegin\fP and \%\f3glEnd\fP delimit the vertices that define a primitive or
a group of like primitives.
\%\f3glBegin\fP accepts a single argument that specifies in which of ten ways the
vertices are interpreted.
Taking $n$ as an integer count starting at one,
and $N$ as the total number of vertices specified,
the interpretations are as follows:
.TP 23
\%\f3GL_POINTS\fP
Treats each vertex as a single point.
Vertex $n$ defines point $n$.
$N$ points are drawn.
.TP
\%\f3GL_LINES\fP
Treats each pair of vertices as an independent line segment.
Vertices $2n^-^1$ and $2n$ define line $n$.
$N/2$ lines are drawn.
.TP
\%\f3GL_LINE_STRIP\fP
Draws a connected group of line segments from the first vertex
to the last.
Vertices $n$ and $n~+~1$ define line $n$.
$N^-^1$ lines are drawn.
.TP
\%\f3GL_LINE_LOOP\fP
Draws a connected group of line segments from the first vertex
to the last,
then back to the first.
Vertices $n$ and $n~+~1$ define line $n$.
The last line, however, is defined by vertices $N$ and $1$.
$N$ lines are drawn.
.TP
\%\f3GL_TRIANGLES\fP
Treats each triplet of vertices as an independent triangle.
Vertices $3n^-^2$, $3n^-^1$, and $3n$ define triangle $n$.
$N/3$ triangles are drawn.
.BP
.TP
\%\f3GL_TRIANGLE_STRIP\fP
Draws a connected group of triangles.  One triangle is defined for each
vertex presented after the first two vertices.  For odd $n$, vertices
$n$, $n~+~1$, and $n~+~2$ define triangle $n$.  For even $n$, vertices
$n~+~1$, $n$, and $n~+~2$ define triangle $n$.  $N^-^2$ triangles are
drawn.
.TP
\%\f3GL_TRIANGLE_FAN\fP
Draws a connected group of triangles.
One triangle is defined for each vertex presented after the first two vertices.
Vertices $1$,
$n~+~1$,
and $n~+~2$ define triangle $n$.
$N^-^2$ triangles are drawn.
.TP
\%\f3GL_QUADS\fP
Treats each group of four vertices as an independent quadrilateral.
Vertices $4n^-^3$, $4n^-^2$, $4n^-^1$, and $4n$
define quadrilateral $n$.
$N/4$ quadrilaterals are drawn.
.TP
\%\f3GL_QUAD_STRIP\fP
Draws a connected group of quadrilaterals.
One quadrilateral is defined for each pair of vertices presented
after the first pair.
Vertices $2n^-^1$, $2n$, $2n~+~2$, and $2n~+~1$ define quadrilateral $n$.
$N/2^-^1$ quadrilaterals are drawn.
Note that the order in which vertices are used to construct a quadrilateral
from strip data is different from that used with independent data.
.TP
\%\f3GL_POLYGON\fP
Draws a single,
convex polygon.
Vertices $1$ through $N$ define this polygon.
.P
Only a subset of GL commands can be used between \%\f3glBegin\fP and \%\f3glEnd\fP.
The commands are
\%\f3glVertex\fP,
\%\f3glColor\fP,
\%\f3glIndex\fP,
\%\f3glNormal\fP,
\%\f3glTexCoord\fP,
\%\f3glEvalCoord\fP,
\%\f3glEvalPoint\fP,
\%\f3glArrayElement\fP,
\%\f3glMaterial\fP, and
\%\f3glEdgeFlag\fP.
Also,
it is acceptable to use
\%\f3glCallList\fP or
\%\f3glCallLists\fP to execute
display lists that include only the preceding commands.
If any other GL command is executed between \%\f3glBegin\fP and \%\f3glEnd\fP,
the error flag is set and the command is ignored.
.P
Regardless of the value chosen for \f2mode\fP,
there is no limit to the number of vertices that can be defined
between \%\f3glBegin\fP and \%\f3glEnd\fP.
Lines,
triangles,
quadrilaterals,
and polygons that are incompletely specified are not drawn.
Incomplete specification results when either too few vertices are
provided to specify even a single primitive or when an incorrect multiple 
of vertices is specified. The incomplete primitive is ignored; the rest are drawn.
.P
The minimum specification of vertices
for each primitive is as follows:
1 for a point,
2 for a line,
3 for a triangle,
4 for a quadrilateral,
and 3 for a polygon.
Modes that require a certain multiple of vertices are
\%\f3GL_LINES\fP (2),
\%\f3GL_TRIANGLES\fP (3),
\%\f3GL_QUADS\fP (4),
and \%\f3GL_QUAD_STRIP\fP (2).
.SH ERRORS
\%\f3GL_INVALID_ENUM\fP is generated if \f2mode\fP is set to an unaccepted value.
.P
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glBegin\fP is executed between a 
\%\f3glBegin\fP
and the corresponding execution of \%\f3glEnd\fP.
.P
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glEnd\fP is executed without being
preceded by a \%\f3glBegin\fP.
.P
\%\f3GL_INVALID_OPERATION\fP is generated if a command other than
\%\f3glVertex\fP,
\%\f3glColor\fP,
\%\f3glIndex\fP,
\%\f3glNormal\fP,
\%\f3glTexCoord\fP,
\%\f3glEvalCoord\fP,
\%\f3glEvalPoint\fP,
\%\f3glArrayElement\fP,
\%\f3glMaterial\fP,
\%\f3glEdgeFlag\fP,
\%\f3glCallList\fP, or
\%\f3glCallLists\fP is executed between
the execution of \%\f3glBegin\fP and the corresponding
execution \%\f3glEnd\fP.
.P
Execution of 
\%\f3glEnableClientState\fP,
\%\f3glDisableClientState\fP,
\%\f3glEdgeFlagPointer\fP,
\%\f3glTexCoordPointer\fP,
\%\f3glColorPointer\fP,
\%\f3glIndexPointer\fP,
\%\f3glNormalPointer\fP,
.br
\%\f3glVertexPointer\fP,
\%\f3glInterleavedArrays\fP, or
\%\f3glPixelStore\fP is not allowed after a call to \%\f3glBegin\fP and before
the corresponding call to \%\f3glEnd\fP,
but an error may or may not be generated.
.SH SEE ALSO
\%\f3glArrayElement(3G)\fP,
\%\f3glCallList(3G)\fP,
\%\f3glCallLists(3G)\fP,
\%\f3glColor(3G)\fP,
\%\f3glEdgeFlag(3G)\fP,
\%\f3glEvalCoord(3G)\fP,
.br
\%\f3glEvalPoint(3G)\fP,
\%\f3glIndex(3G)\fP,
\%\f3glMaterial(3G)\fP,
\%\f3glNormal(3G)\fP,
\%\f3glTexCoord(3G)\fP,
\%\f3glVertex(3G)\fP