include more low-level bindings
[clinton/guile-figl.git] / upstream-man-pages / man2 / glFeedbackBuffer.xml
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="glFeedbackBuffer">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>1991-2006</year>
9 <holder>Silicon Graphics, Inc.</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glFeedbackBuffer</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glFeedbackBuffer</refname>
17 <refpurpose>controls feedback mode</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glFeedbackBuffer</function></funcdef>
23 <paramdef>GLsizei <parameter>size</parameter></paramdef>
24 <paramdef>GLenum <parameter>type</parameter></paramdef>
25 <paramdef>GLfloat * <parameter>buffer</parameter></paramdef>
26 </funcprototype>
27 </funcsynopsis>
28 </refsynopsisdiv>
29 <!-- eqn: ignoring delim $$ -->
30 <refsect1 id="parameters"><title>Parameters</title>
31 <variablelist>
32 <varlistentry>
33 <term><parameter>size</parameter></term>
34 <listitem>
35 <para>
36 Specifies the maximum number of values that can be written into <parameter>buffer</parameter>.
37 </para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>type</parameter></term>
42 <listitem>
43 <para>
44 Specifies a symbolic constant that describes the information
45 that will be returned for each vertex.
46 <constant>GL_2D</constant>,
47 <constant>GL_3D</constant>,
48 <constant>GL_3D_COLOR</constant>,
49 <constant>GL_3D_COLOR_TEXTURE</constant>, and
50 <constant>GL_4D_COLOR_TEXTURE</constant> are accepted.
51 </para>
52 </listitem>
53 </varlistentry>
54 <varlistentry>
55 <term><parameter>buffer</parameter></term>
56 <listitem>
57 <para>
58 Returns the feedback data.
59 </para>
60 </listitem>
61 </varlistentry>
62 </variablelist>
63 </refsect1>
64 <refsect1 id="description"><title>Description</title>
65 <para>
66 The <function>glFeedbackBuffer</function> function controls feedback.
67 Feedback, like selection, is a GL mode.
68 The mode is selected by calling
69 <citerefentry><refentrytitle>glRenderMode</refentrytitle></citerefentry> with <constant>GL_FEEDBACK</constant>.
70 When the GL is in feedback mode,
71 no pixels are produced by rasterization.
72 Instead, information about primitives that would have been
73 rasterized is fed back to the application using the GL.
74 </para>
75 <para>
76 <function>glFeedbackBuffer</function> has three arguments:
77 <parameter>buffer</parameter> is a pointer to an array of floating-point values
78 into which feedback information is placed.
79 <parameter>size</parameter> indicates the size of the array.
80 <parameter>type</parameter> is a symbolic constant describing the information
81 that is fed back for each vertex.
82 <function>glFeedbackBuffer</function> must be issued before feedback mode is enabled
83 (by calling <citerefentry><refentrytitle>glRenderMode</refentrytitle></citerefentry> with argument <constant>GL_FEEDBACK</constant>).
84 Setting <constant>GL_FEEDBACK</constant> without establishing the feedback buffer,
85 or calling <function>glFeedbackBuffer</function> while the GL is in feedback mode,
86 is an error.
87 </para>
88 <para>
89 When <citerefentry><refentrytitle>glRenderMode</refentrytitle></citerefentry> is called while in feedback mode, it returns the number of entries
90 placed in the feedback array and resets the feedback array pointer to the base
91 of the feedback buffer. The returned value never exceeds <parameter>size</parameter>. If the feedback
92 data required more room than was available in <parameter>buffer</parameter>,
93 <citerefentry><refentrytitle>glRenderMode</refentrytitle></citerefentry> returns a negative value.
94 To take the GL out of feedback mode, call
95 <citerefentry><refentrytitle>glRenderMode</refentrytitle></citerefentry> with a parameter value other than <constant>GL_FEEDBACK</constant>.
96 </para>
97 <para>
98 While in feedback mode,
99 each primitive, bitmap, or pixel rectangle that would be rasterized
100 generates a block of values that are copied into the feedback array.
101 If doing so would cause the number of entries to exceed the maximum,
102 the block is partially written so as to fill the array
103 (if there is any room left at all),
104 and an overflow flag is set.
105 Each block begins with a code indicating the primitive type,
106 followed by values that describe the primitive's vertices and
107 associated data.
108 Entries are also written for bitmaps and pixel rectangles.
109 Feedback occurs after polygon culling and <citerefentry><refentrytitle>glPolygonMode</refentrytitle></citerefentry> interpretation
110 of polygons has taken place,
111 so polygons that are culled are not returned in the feedback buffer.
112 It can also occur after polygons with more than three edges are broken up
113 into triangles,
114 if the GL implementation renders polygons by performing this decomposition.
115 </para>
116 <para>
117 The <citerefentry><refentrytitle>glPassThrough</refentrytitle></citerefentry> command can be used to insert a marker
118 into the feedback buffer.
119 See <citerefentry><refentrytitle>glPassThrough</refentrytitle></citerefentry>.
120 </para>
121 <para>
122 Following is the grammar for the blocks of values written
123 into the feedback buffer.
124 Each primitive is indicated with a unique identifying value
125 followed by some number of vertices.
126 Polygon entries include an integer value indicating how many vertices follow.
127 A vertex is fed back as some number of floating-point values,
128 as determined by <parameter>type</parameter>.
129 Colors are fed back as four values in RGBA mode and one value
130 in color index mode.
131 </para>
132
133 <para>
134 <para>
135 feedbackList <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> feedbackItem feedbackList | feedbackItem
136 </para>
137 <para>
138 feedbackItem <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> point | lineSegment | polygon | bitmap | pixelRectangle | passThru
139 </para>
140 <para>
141 point <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> <constant>GL_POINT_TOKEN</constant> vertex
142 </para>
143 <para>
144 lineSegment <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> <constant>GL_LINE_TOKEN</constant> vertex vertex | <constant>GL_LINE_RESET_TOKEN</constant> vertex vertex
145 </para>
146 <para>
147 polygon <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> <constant>GL_POLYGON_TOKEN</constant> n polySpec
148 </para>
149 <para>
150 polySpec <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> polySpec vertex | vertex vertex vertex
151 </para>
152 <para>
153 bitmap <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> <constant>GL_BITMAP_TOKEN</constant> vertex
154 </para>
155 <para>
156 pixelRectangle <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> <constant>GL_DRAW_PIXEL_TOKEN</constant> vertex | <constant>GL_COPY_PIXEL_TOKEN</constant> vertex
157 </para>
158 <para>
159 passThru <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> <constant>GL_PASS_THROUGH_TOKEN</constant> value
160 </para>
161 <para>
162 vertex <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture
163 </para>
164 <para>
165 2d <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> value value
166 </para>
167 <para>
168 3d <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> value value value
169 </para>
170 <para>
171 3dColor <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> value value value color
172 </para>
173 <para>
174 3dColorTexture <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> value value value color tex
175 </para>
176 <para>
177 4dColorTexture <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> value value value value color tex
178 </para>
179 <para>
180 color <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> rgba | index
181 </para>
182 <para>
183 rgba <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> value value value value
184 </para>
185 <para>
186 index <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> value
187 </para>
188 <para>
189 tex <inlineequation><mml:math><mml:mrow><mml:mn>&#x2190;</mml:mn></mml:mrow></mml:math></inlineequation> value value value value
190 </para>
191 <para>
192 </para>
193 </para>
194 <para>
195 <emphasis>value</emphasis>
196 is a floating-point number,
197 and
198 <emphasis>n</emphasis>
199 is a floating-point integer giving the number of vertices in the polygon.
200 <constant>GL_POINT_TOKEN</constant>,
201 <constant>GL_LINE_TOKEN</constant>,
202 <constant>GL_LINE_RESET_TOKEN</constant>,
203 <constant>GL_POLYGON_TOKEN</constant>,
204 <constant>GL_BITMAP_TOKEN</constant>,
205 <constant>GL_DRAW_PIXEL_TOKEN</constant>,
206 <constant>GL_COPY_PIXEL_TOKEN</constant> and
207 <constant>GL_PASS_THROUGH_TOKEN</constant> are symbolic floating-point constants.
208 <constant>GL_LINE_RESET_TOKEN</constant> is returned whenever the line stipple pattern
209 is reset.
210 The data returned as a vertex depends on the feedback <parameter>type</parameter>.
211 </para>
212 <para>
213 The following table gives the correspondence between <parameter>type</parameter>
214 and the number of values per vertex.
215 <emphasis>k</emphasis> is 1 in color index mode and 4 in RGBA mode.
216 </para>
217 <para>
218 </para>
219 <informaltable frame="topbot">
220 <tgroup cols="5" align="left">
221 <colspec colwidth="2.7*" />
222 <colspec colwidth="1.5*" />
223 <colspec colwidth="1*" align="center"/>
224 <colspec colwidth="1*" align="center"/>
225 <colspec colwidth="2.5*" align="center"/>
226 <thead>
227 <row>
228 <entry rowsep="1" align="left"><emphasis role="bold">
229 Type
230 </emphasis></entry>
231 <entry rowsep="1" align="left"><emphasis role="bold">
232 Coordinates
233 </emphasis></entry>
234 <entry rowsep="1" align="center"><emphasis role="bold">
235 Color
236 </emphasis></entry>
237 <entry rowsep="1" align="center"><emphasis role="bold">
238 Texture
239 </emphasis></entry>
240 <entry rowsep="1" align="center"><emphasis role="bold">
241 Total Number of Values
242 </emphasis></entry>
243 </row>
244 </thead>
245 <tbody>
246 <row>
247 <entry align="left">
248 <constant>GL_2D</constant>
249 </entry>
250 <entry align="left">
251 <emphasis>x</emphasis>, <emphasis>y</emphasis>
252 </entry>
253 <entry align="center">
254 </entry>
255 <entry align="center">
256 </entry>
257 <entry align="center">
258 2
259 </entry>
260 </row>
261 <row>
262 <entry align="left">
263 <constant>GL_3D</constant>
264 </entry>
265 <entry align="left">
266 <emphasis>x</emphasis>, <emphasis>y</emphasis>, <emphasis>z</emphasis>
267 </entry>
268 <entry align="center">
269 </entry>
270 <entry align="center">
271 </entry>
272 <entry align="center">
273 3
274 </entry>
275 </row>
276 <row>
277 <entry align="left">
278 <constant>GL_3D_COLOR</constant>
279 </entry>
280 <entry align="left">
281 <emphasis>x</emphasis>, <emphasis>y</emphasis>, <emphasis>z</emphasis>
282 </entry>
283 <entry align="center">
284 <inlineequation><mml:math><mml:mi mathvariant="italic">k</mml:mi></mml:math></inlineequation>
285 </entry>
286 <entry align="center">
287 </entry>
288 <entry align="center">
289 <inlineequation><mml:math>
290 <!-- eqn: 3 + k:-->
291 <mml:mrow>
292 <mml:mn>3</mml:mn>
293 <mml:mo>+</mml:mo>
294 <mml:mi mathvariant="italic">k</mml:mi>
295 </mml:mrow>
296 </mml:math></inlineequation>
297 </entry>
298 </row>
299 <row>
300 <entry align="left">
301 <constant>GL_3D_COLOR_TEXTURE</constant>
302 </entry>
303 <entry align="left">
304 <emphasis>x</emphasis>, <emphasis>y</emphasis>, <emphasis>z</emphasis>
305 </entry>
306 <entry align="center">
307 <inlineequation><mml:math><mml:mi mathvariant="italic">k</mml:mi></mml:math></inlineequation>
308 </entry>
309 <entry align="center">
310 4
311 </entry>
312 <entry align="center">
313 <inlineequation><mml:math>
314 <!-- eqn: 7 + k:-->
315 <mml:mrow>
316 <mml:mn>7</mml:mn>
317 <mml:mo>+</mml:mo>
318 <mml:mi mathvariant="italic">k</mml:mi>
319 </mml:mrow>
320 </mml:math></inlineequation>
321 </entry>
322 </row>
323 <row>
324 <entry align="left">
325 <constant>GL_4D_COLOR_TEXTURE</constant>
326 </entry>
327 <entry align="left">
328 <emphasis>x</emphasis>, <emphasis>y</emphasis>, <emphasis>z</emphasis>, <emphasis>w</emphasis>
329 </entry>
330 <entry align="center">
331 <inlineequation><mml:math><mml:mi mathvariant="italic">k</mml:mi></mml:math></inlineequation>
332 </entry>
333 <entry align="center">
334 4
335 </entry>
336 <entry align="center">
337 <inlineequation><mml:math>
338 <!-- eqn: 8 + k:-->
339 <mml:mrow>
340 <mml:mn>8</mml:mn>
341 <mml:mo>+</mml:mo>
342 <mml:mi mathvariant="italic">k</mml:mi>
343 </mml:mrow>
344 </mml:math></inlineequation>
345 </entry>
346 </row>
347 </tbody>
348 </tgroup>
349 </informaltable>
350 <para>
351 Feedback vertex coordinates are in window coordinates,
352 except <emphasis>w</emphasis>,
353 which is in clip coordinates.
354 Feedback colors are lighted, if lighting is enabled.
355 Feedback texture coordinates are generated,
356 if texture coordinate generation is enabled.
357 They are always transformed by the texture matrix.
358 </para>
359 </refsect1>
360 <refsect1 id="notes"><title>Notes</title>
361 <para>
362 <function>glFeedbackBuffer</function>, when used in a display list, is not compiled into the display list
363 but is executed immediately.
364 </para>
365 <para>
366 <function>glFeedbackBuffer</function> returns only the texture coordinate of texture unit <constant>GL_TEXTURE0</constant>.
367 </para>
368 </refsect1>
369 <refsect1 id="errors"><title>Errors</title>
370 <para>
371 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>type</parameter> is not an accepted value.
372 </para>
373 <para>
374 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>size</parameter> is negative.
375 </para>
376 <para>
377 <constant>GL_INVALID_OPERATION</constant> is generated if <function>glFeedbackBuffer</function> is called while the
378 render mode is <constant>GL_FEEDBACK</constant>,
379 or if <citerefentry><refentrytitle>glRenderMode</refentrytitle></citerefentry> is called with argument <constant>GL_FEEDBACK</constant> before
380 <function>glFeedbackBuffer</function> is called at least once.
381 </para>
382 <para>
383 <constant>GL_INVALID_OPERATION</constant> is generated if <function>glFeedbackBuffer</function>
384 is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
385 and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
386 </para>
387 </refsect1>
388 <refsect1 id="associatedgets"><title>Associated Gets</title>
389 <para>
390 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_RENDER_MODE</constant>
391 </para>
392 <para>
393 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_FEEDBACK_BUFFER_POINTER</constant>
394 </para>
395 <para>
396 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_FEEDBACK_BUFFER_SIZE</constant>
397 </para>
398 <para>
399 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_FEEDBACK_BUFFER_TYPE</constant>
400 </para>
401 </refsect1>
402 <refsect1 id="seealso"><title>See Also</title>
403 <para>
404 <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>,
405 <citerefentry><refentrytitle>glLineStipple</refentrytitle></citerefentry>,
406 <citerefentry><refentrytitle>glPassThrough</refentrytitle></citerefentry>,
407 <citerefentry><refentrytitle>glPolygonMode</refentrytitle></citerefentry>,
408 <citerefentry><refentrytitle>glRenderMode</refentrytitle></citerefentry>,
409 <citerefentry><refentrytitle>glSelectBuffer</refentrytitle></citerefentry>
410 </para>
411 </refsect1>
412 <refsect1 id="Copyright"><title>Copyright</title>
413 <para>
414 Copyright <trademark class="copyright"></trademark> 1991-2006
415 Silicon Graphics, Inc. This document is licensed under the SGI
416 Free Software B License. For details, see
417 <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
418 </para>
419 </refsect1>
420 </refentry>