File: feedbackbuffer.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 (225 lines) | stat: -rw-r--r-- 7,508 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
218
219
220
221
222
223
224
225
'\" 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 feedbackb
.ds Xs 26060 9 feedbackbuffer.gl
.TH GLFEEDBACKBUFFER 3G
.SH NAME
.B "glFeedbackBuffer
\- controls feedback mode

.SH C SPECIFICATION
void \f3glFeedbackBuffer\fP(
GLsizei \fIsize\fP,
.nf
.ta \w'\f3void \fPglFeedbackBuffer( 'u
	GLenum \fItype\fP,
	GLfloat \fI*buffer\fP )
.fi

.EQ
delim $$
.EN
.SH PARAMETERS
.TP \w'\fIbuffer\fP\ \ 'u 
\f2size\fP
Specifies the maximum number of values that can be written into \f2buffer\fP.
.TP
\f2type\fP 
Specifies a symbolic constant that describes the information
that will be returned for each vertex.
\%\f3GL_2D\fP,
\%\f3GL_3D\fP,
\%\f3GL_3D_COLOR\fP,
\%\f3GL_3D_COLOR_TEXTURE\fP, and
\%\f3GL_4D_COLOR_TEXTURE\fP are accepted.
.TP
\f2buffer\fP
Returns the feedback data.
.SH DESCRIPTION
The \%\f3glFeedbackBuffer\fP function controls feedback.
Feedback, like selection, is a GL mode.
The mode is selected by calling
\%\f3glRenderMode\fP with \%\f3GL_FEEDBACK\fP.
When the GL is in feedback mode,
no pixels are produced by rasterization.
Instead, information about primitives that would have been
rasterized is fed back to the application using the GL.
.P
\%\f3glFeedbackBuffer\fP has three arguments:
\f2buffer\fP is a pointer to an array of floating-point values
into which feedback information is placed.
\f2size\fP indicates the size of the array.
\f2type\fP is a symbolic constant describing the information
that is fed back for each vertex.
\%\f3glFeedbackBuffer\fP must be issued before feedback mode is enabled
(by calling \%\f3glRenderMode\fP with argument \%\f3GL_FEEDBACK\fP).
Setting \%\f3GL_FEEDBACK\fP without establishing the feedback buffer,
or calling \%\f3glFeedbackBuffer\fP while the GL is in feedback mode,
is an error.
.P
When \%\f3glRenderMode\fP is called while in feedback mode, it returns the number of entries
placed in the feedback array, and resets the feedback array pointer to the base
of the feedback buffer. The returned value never exceeds \f2size\fP. If the feedback
data required more room than was available in \f2buffer\fP, 
\%\f3glRenderMode\fP returns a negative value.
To take the GL out of feedback mode, call
\%\f3glRenderMode\fP with a parameter value other than \%\f3GL_FEEDBACK\fP.
.P
While in feedback mode,
each primitive, bitmap, or pixel rectangle that would be rasterized
generates a block of values that are copied into the feedback array.
If doing so would cause the number of entries to exceed the maximum,
the block is partially written so as to fill the array
(if there is any room left at all),
and an overflow flag is set.
Each block begins with a code indicating the primitive type,
followed by values that describe the primitive's vertices and
associated data.
Entries are also written for bitmaps and pixel rectangles.
Feedback occurs after polygon culling and \%\f3glPolygonMode\fP interpretation
of polygons has taken place,
so polygons that are culled are not returned in the feedback buffer.
It can also occur after polygons with more than three edges are broken up
into triangles,
if the GL implementation renders polygons by performing this decomposition.
.P
The \%\f3glPassThrough\fP command can be used to insert a marker
into the feedback buffer.
See \%\f3glPassThrough\fP.
.P
Following is the grammar for the blocks of values written
into the feedback buffer.
Each primitive is indicated with a unique identifying value
followed by some number of vertices.
Polygon entries include an integer value indicating how many vertices follow.
A vertex is fed back as some number of floating-point values,
as determined by \f2type\fP.
Colors are fed back as four values in RGBA mode and one value
in color index mode. 
.RS
.na
.sp
feedbackList \(<- feedbackItem feedbackList | feedbackItem
.sp
feedbackItem \(<- point | lineSegment | polygon | bitmap | pixelRectangle | passThru
.sp
point \(<- \%\f3GL_POINT_TOKEN\fP vertex
.sp
lineSegment \(<- \%\f3GL_LINE_TOKEN\fP vertex vertex | \%\f3GL_LINE_RESET_TOKEN\fP vertex vertex
.sp
polygon \(<- \%\f3GL_POLYGON_TOKEN\fP n polySpec
.sp
polySpec \(<- polySpec vertex | vertex vertex vertex
.sp
bitmap \(<- \%\f3GL_BITMAP_TOKEN\fP vertex 
.sp
pixelRectangle \(<- \%\f3GL_DRAW_PIXEL_TOKEN\fP vertex | \%\f3GL_COPY_PIXEL_TOKEN\fP vertex
.sp
passThru \(<- \%\f3GL_PASS_THROUGH_TOKEN\fP value
.sp
vertex \(<- 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture
.sp
2d \(<- value value
.sp
3d \(<- value value value
.sp
3dColor  \(<- value value value color
.sp
3dColorTexture \(<- value value value color tex
.sp
4dColorTexture \(<- value value value value color tex
.sp
color \(<- rgba | index
.sp
rgba \(<- value value value value
.sp
index \(<- value
.sp
tex \(<- value value value value
.sp
.RE
.P
.I value
is a floating-point number, 
and
.I n
is a floating-point integer giving the number of vertices in the polygon.
\%\f3GL_POINT_TOKEN\fP, 
\%\f3GL_LINE_TOKEN\fP,
\%\f3GL_LINE_RESET_TOKEN\fP,
\%\f3GL_POLYGON_TOKEN\fP,
\%\f3GL_BITMAP_TOKEN\fP,
\%\f3GL_DRAW_PIXEL_TOKEN\fP,
\%\f3GL_COPY_PIXEL_TOKEN\fP and
\%\f3GL_PASS_THROUGH_TOKEN\fP are symbolic floating-point constants.
\%\f3GL_LINE_RESET_TOKEN\fP is returned whenever the line stipple pattern
is reset.
The data returned as a vertex depends on the feedback \f2type\fP.
.P
The following table gives the correspondence between \f2type\fP
and the number of values per vertex.
\f2k\fP is 1 in color index mode and 4 in RGBA mode.
.sp
.ne
.TS
center tab(:);
lb lb cb cb cb
l l c c c.
_
Type:Coordinates:Color:Texture:Total Number of Values
_
\%\f3GL_2D\fP:\f2x\fP, \f2y\fP:::2
\%\f3GL_3D\fP:\f2x\fP, \f2y\fP, \f2z\fP:::3
\%\f3GL_3D_COLOR\fP:\f2x\fP, \f2y\fP, \f2z\fP:$k$::$3 ~+~ k$
\%\f3GL_3D_COLOR_TEXTURE\fP:\f2x\fP, \f2y\fP, \f2z\fP,:$k$:4:$7 ~+~ k$
\%\f3GL_4D_COLOR_TEXTURE\fP:\f2x\fP, \f2y\fP, \f2z\fP, \f2w\fP:$k$:4:$8 ~+~ k$
_
.TE

.P
Feedback vertex coordinates are in window coordinates,
except \f2w\fP,
which is in clip coordinates.
Feedback colors are lighted, if lighting is enabled.
Feedback texture coordinates are generated,
if texture coordinate generation is enabled.
They are always transformed by the texture matrix.
.SH NOTES
\%\f3glFeedbackBuffer\fP, when used in a display list, is not compiled into the display list 
but is executed immediately. 
.P
When the \%\f3GL_ARB_multitexture\fP extension is supported, \%\f3glFeedbackBuffer\fP
returns only the texture coordinates of texture unit \%\f3GL_TEXTURE0_ARB\fP.
.SH ERRORS
\%\f3GL_INVALID_ENUM\fP is generated if \f2type\fP is not an accepted value.
.P
\%\f3GL_INVALID_VALUE\fP is generated if \f2size\fP is negative.
.P
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glFeedbackBuffer\fP is called while the
render mode is \%\f3GL_FEEDBACK\fP,
or if \%\f3glRenderMode\fP is called with argument \%\f3GL_FEEDBACK\fP before
\%\f3glFeedbackBuffer\fP is called at least once.
.P
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glFeedbackBuffer\fP
is executed between the execution of \%\f3glBegin\fP
and the corresponding execution of \%\f3glEnd\fP.
.SH ASSOCIATED GETS
\%\f3glGet\fP with argument \%\f3GL_RENDER_MODE\fP
.br
\%\f3glGet\fP with argument \%\f3GL_FEEDBACK_BUFFER_POINTER\fP
.br
\%\f3glGet\fP with argument \%\f3GL_FEEDBACK_BUFFER_SIZE\fP
.br
\%\f3glGet\fP with argument \%\f3GL_FEEDBACK_BUFFER_TYPE\fP
.SH SEE ALSO
\%\f3glBegin(3G)\fP,
\%\f3glLineStipple(3G)\fP,
\%\f3glPassThrough(3G)\fP,
\%\f3glPolygonMode(3G)\fP,
\%\f3glRenderMode(3G)\fP,
\%\f3glSelectBuffer(3G)\fP