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">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glFeedbackBuffer
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glFeedbackBuffer
</refname>
17 <refpurpose>controls feedback mode
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
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>
29 <!-- eqn: ignoring delim $$ -->
30 <refsect1 id=
"parameters"><title>Parameters
</title>
33 <term><parameter>size
</parameter></term>
36 Specifies the maximum number of values that can be written into
<parameter>buffer
</parameter>.
41 <term><parameter>type
</parameter></term>
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.
55 <term><parameter>buffer
</parameter></term>
58 Returns the feedback data.
64 <refsect1 id=
"description"><title>Description
</title>
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.
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,
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>.
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
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
114 if the GL implementation renders polygons by performing this decomposition.
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>.
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
135 feedbackList
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> feedbackItem feedbackList | feedbackItem
138 feedbackItem
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> point | lineSegment | polygon | bitmap | pixelRectangle | passThru
141 point
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> <constant>GL_POINT_TOKEN
</constant> vertex
144 lineSegment
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> <constant>GL_LINE_TOKEN
</constant> vertex vertex |
<constant>GL_LINE_RESET_TOKEN
</constant> vertex vertex
147 polygon
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> <constant>GL_POLYGON_TOKEN
</constant> n polySpec
150 polySpec
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> polySpec vertex | vertex vertex vertex
153 bitmap
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> <constant>GL_BITMAP_TOKEN
</constant> vertex
156 pixelRectangle
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> <constant>GL_DRAW_PIXEL_TOKEN
</constant> vertex |
<constant>GL_COPY_PIXEL_TOKEN
</constant> vertex
159 passThru
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> <constant>GL_PASS_THROUGH_TOKEN
</constant> value
162 vertex
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> 2d |
3d |
3dColor |
3dColorTexture |
4dColorTexture
165 2d
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> value value
168 3d
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> value value value
171 3dColor
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> value value value color
174 3dColorTexture
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> value value value color tex
177 4dColorTexture
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> value value value value color tex
180 color
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> rgba | index
183 rgba
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> value value value value
186 index
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> value
189 tex
<inlineequation><mml:math><mml:mrow><mml:mn>←</mml:mn></mml:mrow></mml:math></inlineequation> value value value value
195 <emphasis>value
</emphasis>
196 is a floating-point number,
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
210 The data returned as a vertex depends on the feedback
<parameter>type
</parameter>.
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.
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"/>
228 <entry rowsep=
"1" align=
"left"><emphasis role=
"bold">
231 <entry rowsep=
"1" align=
"left"><emphasis role=
"bold">
234 <entry rowsep=
"1" align=
"center"><emphasis role=
"bold">
237 <entry rowsep=
"1" align=
"center"><emphasis role=
"bold">
240 <entry rowsep=
"1" align=
"center"><emphasis role=
"bold">
241 Total Number of Values
248 <constant>GL_2D
</constant>
251 <emphasis>x
</emphasis>,
<emphasis>y
</emphasis>
253 <entry align=
"center">
255 <entry align=
"center">
257 <entry align=
"center">
263 <constant>GL_3D
</constant>
266 <emphasis>x
</emphasis>,
<emphasis>y
</emphasis>,
<emphasis>z
</emphasis>
268 <entry align=
"center">
270 <entry align=
"center">
272 <entry align=
"center">
278 <constant>GL_3D_COLOR
</constant>
281 <emphasis>x
</emphasis>,
<emphasis>y
</emphasis>,
<emphasis>z
</emphasis>
283 <entry align=
"center">
284 <inlineequation><mml:math><mml:mi mathvariant=
"italic">k
</mml:mi></mml:math></inlineequation>
286 <entry align=
"center">
288 <entry align=
"center">
289 <inlineequation><mml:math>
294 <mml:mi mathvariant=
"italic">k
</mml:mi>
296 </mml:math></inlineequation>
301 <constant>GL_3D_COLOR_TEXTURE
</constant>
304 <emphasis>x
</emphasis>,
<emphasis>y
</emphasis>,
<emphasis>z
</emphasis>
306 <entry align=
"center">
307 <inlineequation><mml:math><mml:mi mathvariant=
"italic">k
</mml:mi></mml:math></inlineequation>
309 <entry align=
"center">
312 <entry align=
"center">
313 <inlineequation><mml:math>
318 <mml:mi mathvariant=
"italic">k
</mml:mi>
320 </mml:math></inlineequation>
325 <constant>GL_4D_COLOR_TEXTURE
</constant>
328 <emphasis>x
</emphasis>,
<emphasis>y
</emphasis>,
<emphasis>z
</emphasis>,
<emphasis>w
</emphasis>
330 <entry align=
"center">
331 <inlineequation><mml:math><mml:mi mathvariant=
"italic">k
</mml:mi></mml:math></inlineequation>
333 <entry align=
"center">
336 <entry align=
"center">
337 <inlineequation><mml:math>
342 <mml:mi mathvariant=
"italic">k
</mml:mi>
344 </mml:math></inlineequation>
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.
360 <refsect1 id=
"notes"><title>Notes
</title>
362 <function>glFeedbackBuffer
</function>, when used in a display list, is not compiled into the display list
363 but is executed immediately.
366 <function>glFeedbackBuffer
</function> returns only the texture coordinate of texture unit
<constant>GL_TEXTURE0
</constant>.
369 <refsect1 id=
"errors"><title>Errors
</title>
371 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>type
</parameter> is not an accepted value.
374 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>size
</parameter> is negative.
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.
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>.
388 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
390 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_RENDER_MODE
</constant>
393 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_FEEDBACK_BUFFER_POINTER
</constant>
396 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_FEEDBACK_BUFFER_SIZE
</constant>
399 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_FEEDBACK_BUFFER_TYPE
</constant>
402 <refsect1 id=
"seealso"><title>See Also
</title>
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>
412 <refsect1 id=
"Copyright"><title>Copyright
</title>
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>.