GLenum _t_y_p_e, GLfloat _*_b_u_f_f_e_r )
delim $$
ggllFFeeeeddbbaacckkBBuuffffeerr has three arguments: _b_u_f_f_e_r is a pointer to an array of floating-point values into which feedback information is placed. _s_i_z_e indicates the size of the array. _t_y_p_e is a symbolic constant describing the information that is fed back for each vertex. ggllFFeeeeddbbaacckkBBuuffffeerr must be issued before feedback mode is enabled (by calling ggllRReennddeerrMMooddee with argument GGLL__FFEEEEDDBBAACCKK). Setting GGLL__FFEEEEDDBBAACCKK without establishing the feedback buffer, or calling ggllFFeeeeddbbaacckkBBuuffffeerr while the GL is in feedback mode, is an error.
When ggllRReennddeerrMMooddee 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 _s_i_z_e. If the feedback data required more room than was available in _b_u_f_f_e_r, ggllRReennddeerrMMooddee returns a negative value. To take the GL out of feedback mode, call ggllRReennddeerrMMooddee with a parameter value other than GGLL__FFEEEEDDBBAACCKK.
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 ggllPPoollyyggoonnMMooddee 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.
The ggllPPaassssTThhrroouugghh command can be used to insert a marker into the feedback buffer. See ggllPPaassssTThhrroouugghh.
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 _t_y_p_e.
Colors are fed back as four values in RGBA mode and one value
in color index mode.
feedbackList <- feedbackItem feedbackList | feedbackItem
feedbackItem <- point | lineSegment | polygon | bitmap | pixelRectangle | passThru
point <- GGLL__PPOOIINNTT__TTOOKKEENN vertex
lineSegment <- GGLL__LLIINNEE__TTOOKKEENN vertex vertex | GGLL__LLIINNEE__RREESSEETT__TTOOKKEENN vertex vertex
polygon <- GGLL__PPOOLLYYGGOONN__TTOOKKEENN n polySpec
polySpec <- polySpec vertex | vertex vertex vertex
bitmap <- GGLL__BBIITTMMAAPP__TTOOKKEENN vertex
pixelRectangle <- GGLL__DDRRAAWW__PPIIXXEELL__TTOOKKEENN vertex | GGLL__CCOOPPYY__PPIIXXEELL__TTOOKKEENN vertex
passThru <- GGLL__PPAASSSS__TTHHRROOUUGGHH__TTOOKKEENN 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
value is a floating-point number, and n is a floating-point integer giving the number of vertices in the polygon. GGLL__PPOOIINNTT__TTOOKKEENN, GGLL__LLIINNEE__TTOOKKEENN, GGLL__LLIINNEE__RREESSEETT__TTOOKKEENN, GGLL__PPOOLLYYGGOONN__TTOOKKEENN, GGLL__BBIITTMMAAPP__TTOOKKEENN, GGLL__DDRRAAWW__PPIIXXEELL__TTOOKKEENN, GGLL__CCOOPPYY__PPIIXXEELL__TTOOKKEENN and GGLL__PPAASSSS__TTHHRROOUUGGHH__TTOOKKEENN are symbolic floating-point constants. GGLL__LLIINNEE__RREESSEETT__TTOOKKEENN is returned whenever the line stipple pattern is reset. The data returned as a vertex depends on the feedback _t_y_p_e.
The following table gives the correspondence between _t_y_p_e
and the number of values per vertex.
_k is 1 in color index mode and 4 in RGBA mode.
center tab(:); lb lb cb cb cb l l c c c. _ Type:Coordinates:Color:Texture:Total Number of Values _ GGLL__22DD:_x, _y:::2 GGLL__33DD:_x, _y, _z:::3 GGLL__33DD__CCOOLLOORR:_x, _y, _z:$k$::$3 ~+~ k$ GGLL__33DD__CCOOLLOORR__TTEEXXTTUURREE:_x, _y, _z,:$k$:4:$7 ~+~ k$ GGLL__44DD__CCOOLLOORR__TTEEXXTTUURREE:_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 generation is enabled. They are always transformed by the texture matrix.
When the GGLL__AARRBB__mmuullttiitteexxttuurree extension is supported, ggllFFeeeeddbbaacckkBBuuffffeerr returns only the texture coordinates of texture unit GGLL__TTEEXXTTUURREE00__AARRBB.
GGLL__IINNVVAALLIIDD__VVAALLUUEE is generated if _s_i_z_e is negative.
GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if ggllFFeeeeddbbaacckkBBuuffffeerr is called while the render mode is GGLL__FFEEEEDDBBAACCKK, or if ggllRReennddeerrMMooddee is called with argument GGLL__FFEEEEDDBBAACCKK before ggllFFeeeeddbbaacckkBBuuffffeerr is called at least once.
GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if ggllFFeeeeddbbaacckkBBuuffffeerr is executed between the execution of ggllBBeeggiinn and the corresponding execution of ggllEEnndd.