- controls feedback mode
C SPECIFICATION
PARAMETERS
_param1 Specifies the maximum number of values that can
be written into _param3.
_param2 Specifies a symbolic constant that describes the
information that will be returned for each ver-
tex. GL_2D, GL_3D, GL_3D_COLOR,
GL_3D_COLOR_TEXTURE, and GL_4D_COLOR_TEXTURE are
accepted.
_param3 Returns the feedback data.
DESCRIPTION
The glFeedbackBuffer function controls feedback. Feed-
back, like selection, is a GL mode. The mode is selected
by calling glRenderMode with GL_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.
glFeedbackBuffer 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.
glFeedbackBuffer must be issued before feedback mode is
enabled (by calling glRenderMode with argument
GL_FEEDBACK). Setting GL_FEEDBACK without establishing
the feedback buffer, or calling glFeedbackBuffer while the
GL is in feedback mode, is an error.
When glRenderMode 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, glRenderMode returns a negative
value. To take the GL out of feedback mode, call
glRenderMode with a parameter value other than
GL_FEEDBACK.
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 maxi-
mum, 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
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 indi-
cating 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.
feedbackList <- feedbackItem feedbackList | feed-
backItem
feedbackItem <- point | lineSegment | polygon |
bitmap | pixelRectangle | passThru
point <- GL_POINT_TOKEN vertex
lineSegment <- GL_LINE_TOKEN vertex vertex |
GL_LINE_RESET_TOKEN vertex vertex
polygon <- GL_POLYGON_TOKEN n polySpec
polySpec <- polySpec vertex | vertex vertex vertex
bitmap <- GL_BITMAP_TOKEN vertex
pixelRectangle <- GL_DRAW_PIXEL_TOKEN vertex |
GL_COPY_PIXEL_TOKEN vertex
passThru <- GL_PASS_THROUGH_TOKEN value
vertex <- 2d | 3d | 3dColor | 3dColorTexture |
4dColorTexture
2d <- value value
3d <- value value value
3dColor <- value value value color
3dColorTexture <- value value value color tex
4dColorTexture <- value value value value color tex
color <- rgba | index
rgba <- value value value value
index <- value
tex <- value value value value
Type Coordinates Color Texture Total Number of Values
-----------------------------------------------------------------------------
GL_2D x, y 2
GL_3D x, y, z 3
GL_3D_COLOR x, y, z k 3+k
GL_3D_COLOR_TEXTURE x, y, z, k 4 7+k
GL_4D_COLOR_TEXTURE x, y, z, w k 4 8+k
-----------------------------------------------------------------------------
Feedback vertex coordinates are in window coordinates,
except w, which is in clip coordinates. Feedback colors
are lighted, if lighting is enabled. Feedback texture
coordinates are generated, if texture coordinate genera-
tion is enabled. They are always transformed by the tex-
ture matrix.
NOTES
glFeedbackBuffer, when used in a display list, is not com-
piled into the display list but is executed immediately.
When the GL_ARB_multitexture extension is supported,
glFeedbackBuffer returns only the texture coordinates of
texture unit GL_TEXTURE0_ARB.
ERRORS
GL_INVALID_ENUM is generated if _param2 is not an accepted
value.
GL_INVALID_VALUE is generated if _param1 is negative.
GL_INVALID_OPERATION is generated if glFeedbackBuffer is
called while the render mode is GL_FEEDBACK, or if
glRenderMode is called with argument GL_FEEDBACK before
glFeedbackBuffer is called at least once.
GL_INVALID_OPERATION is generated if glFeedbackBuffer is
executed between the execution of glBegin and the corre-
sponding execution of glEnd.
ASSOCIATED GETS
glGet with argument GL_RENDER_MODE
glGet with argument GL_FEEDBACK_BUFFER_POINTER
glGet with argument GL_FEEDBACK_BUFFER_SIZE
glGet with argument GL_FEEDBACK_BUFFER_TYPE
SEE ALSO
glBegin, glLineStipple, glPassThrough, glPolygonMode,
glRenderMode, glSelectBuffer