aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/extras/ogl-sample/main/doc/man/mangl/standard/feedbackbuffer.gl
blob: 5d32f36df7e557959ecb2913c3486bc590f224ce (plain)
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
226
227
228
229
230
231
232
233
234
235
236
237
_C_ License Applicability. Except to the extent portions of this file are
_C_ made subject to an alternative license as permitted in the SGI Free
_C_ Software License B, Version 1.1 (the "License"), the contents of this
_C_ file are subject only to the provisions of the License. You may not use
_C_ this file except in compliance with the License. You may obtain a copy
_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
_C_ 
_C_ http://oss.sgi.com/projects/FreeB
_C_ 
_C_ Note that, as provided in the License, the Software is distributed on an
_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
_C_ 
_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
_C_ Copyright in any portions created by third parties is as indicated
_C_ elsewhere herein. All Rights Reserved.
_C_ 
_C_ Additional Notice Provisions: The application programming interfaces
_C_ established by SGI in conjunction with the Original Code are The
_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
_C_ published by SGI, but has not been independently verified as being
_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
_C_
_C_ The first character in this file must be an '_'!
_C_ Anything on a line after _C_ is ignored
_define(_filters,tbl|eqn)_C_
_C_      eqn is automatically replaced with neqn for nroff
_header(FeedbackBuffer,controls feedback mode)
_names(FeedbackBuffer)
.EQ
delim $$
.EN
.SH PARAMETERS
_phead(_param1)
Specifies the maximum number of values that can be written into _param3.
_phead(_param2) 
Specifies a symbolic constant that describes the information
that will be returned for each vertex.
_const(2D),
_const(3D),
_const(3D_COLOR),
_const(3D_COLOR_TEXTURE), and
_const(4D_COLOR_TEXTURE) are accepted.
_phead(_param3)
Returns the feedback data.
.SH DESCRIPTION
The _cmnd function controls feedback.
Feedback, like selection, is a GL mode.
The mode is selected by calling
_cmnd(RenderMode) with _const(FEEDBACK).
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
_cmnd has three arguments:
_param3 is a pointer to an array of floating-point values
into which feedback information is placed.
_param1 indicates the size of the array.
_param2 is a symbolic constant describing the information
that is fed back for each vertex.
_cmnd must be issued before feedback mode is enabled
(by calling _cmnd(RenderMode) with argument _const(FEEDBACK)).
Setting _const(FEEDBACK) without establishing the feedback buffer,
or calling _cmnd while the GL is in feedback mode,
is an error.
.P
When _cmnd(RenderMode) 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 _param1. If the feedback
data required more room than was available in _param3, 
_cmnd(RenderMode) returns a negative value.
To take the GL out of feedback mode, call
_cmnd(RenderMode) with a parameter value other than _const(FEEDBACK).
.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 _cmnd(PolygonMode) 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 _cmnd(PassThrough) command can be used to insert a marker
into the feedback buffer.
See _cmnd(PassThrough).
.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 _param2.
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 \(<- _const(POINT_TOKEN) vertex
.sp
lineSegment \(<- _const(LINE_TOKEN) vertex vertex | _const(LINE_RESET_TOKEN) vertex vertex
.sp
polygon \(<- _const(POLYGON_TOKEN) n polySpec
.sp
polySpec \(<- polySpec vertex | vertex vertex vertex
.sp
bitmap \(<- _const(BITMAP_TOKEN) vertex 
.sp
pixelRectangle \(<- _const(DRAW_PIXEL_TOKEN) vertex | _const(COPY_PIXEL_TOKEN) vertex
.sp
passThru \(<- _const(PASS_THROUGH_TOKEN) 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.
_const(POINT_TOKEN), 
_const(LINE_TOKEN),
_const(LINE_RESET_TOKEN),
_const(POLYGON_TOKEN),
_const(BITMAP_TOKEN),
_const(DRAW_PIXEL_TOKEN),
_const(COPY_PIXEL_TOKEN) and
_const(PASS_THROUGH_TOKEN) are symbolic floating-point constants.
_const(LINE_RESET_TOKEN) is returned whenever the line stipple pattern
is reset.
The data returned as a vertex depends on the feedback _param2.
.P
The following table gives the correspondence between _param2
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
_
_const(2D):\f2x\fP, \f2y\fP:::2
_const(3D):\f2x\fP, \f2y\fP, \f2z\fP:::3
_const(3D_COLOR):\f2x\fP, \f2y\fP, \f2z\fP:$k$::$3 ~+~ k$
_const(3D_COLOR_TEXTURE):\f2x\fP, \f2y\fP, \f2z\fP,:$k$:4:$7 ~+~ k$
_const(4D_COLOR_TEXTURE):\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
_cmnd, when used in a display list, is not compiled into the display list 
but is executed immediately. 
.P
When the _arbstring(multitexture) extension is supported, _cmnd
returns only the texture coordinates of texture unit _arbconst(TEXTURE0).
.SH ERRORS
_const(INVALID_ENUM) is generated if _param2 is not an accepted value.
.P
_const(INVALID_VALUE) is generated if _param1 is negative.
.P
_const(INVALID_OPERATION) is generated if _cmnd is called while the
render mode is _const(FEEDBACK),
or if _cmnd(RenderMode) is called with argument _const(FEEDBACK) before
_cmnd is called at least once.
.P
_const(INVALID_OPERATION) is generated if _cmnd
is executed between the execution of _cmnd(Begin)
and the corresponding execution of _cmnd(End).
.SH ASSOCIATED GETS
_cmnd(Get) with argument _const(RENDER_MODE)
.br
_cmnd(Get) with argument _const(FEEDBACK_BUFFER_POINTER)
.br
_cmnd(Get) with argument _const(FEEDBACK_BUFFER_SIZE)
.br
_cmnd(Get) with argument _const(FEEDBACK_BUFFER_TYPE)
.SH SEE ALSO
_cmnd(Begin),
_cmnd(LineStipple),
_cmnd(PassThrough),
_cmnd(PolygonMode),
_cmnd(RenderMode),
_cmnd(SelectBuffer)