feedbackbuffer.3gl 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. '\" te
  2. '\"! tbl|eqn | mmdoc
  3. '\"macro stdmacro
  4. .ds Vn Version 1.2
  5. .ds Dt 24 September 1999
  6. .ds Re Release 1.2.1
  7. .ds Dp Jan 14 18:30
  8. .ds Dm 01 feedbackb
  9. .ds Xs 26060 9 feedbackbuffer.gl
  10. .TH GLFEEDBACKBUFFER 3G
  11. .SH NAME
  12. .B "glFeedbackBuffer
  13. \- controls feedback mode
  14. .SH C SPECIFICATION
  15. void \f3glFeedbackBuffer\fP(
  16. GLsizei \fIsize\fP,
  17. .nf
  18. .ta \w'\f3void \fPglFeedbackBuffer( 'u
  19. GLenum \fItype\fP,
  20. GLfloat \fI*buffer\fP )
  21. .fi
  22. .EQ
  23. delim $$
  24. .EN
  25. .SH PARAMETERS
  26. .TP \w'\fIbuffer\fP\ \ 'u
  27. \f2size\fP
  28. Specifies the maximum number of values that can be written into \f2buffer\fP.
  29. .TP
  30. \f2type\fP
  31. Specifies a symbolic constant that describes the information
  32. that will be returned for each vertex.
  33. \%\f3GL_2D\fP,
  34. \%\f3GL_3D\fP,
  35. \%\f3GL_3D_COLOR\fP,
  36. \%\f3GL_3D_COLOR_TEXTURE\fP, and
  37. \%\f3GL_4D_COLOR_TEXTURE\fP are accepted.
  38. .TP
  39. \f2buffer\fP
  40. Returns the feedback data.
  41. .SH DESCRIPTION
  42. The \%\f3glFeedbackBuffer\fP function controls feedback.
  43. Feedback, like selection, is a GL mode.
  44. The mode is selected by calling
  45. \%\f3glRenderMode\fP with \%\f3GL_FEEDBACK\fP.
  46. When the GL is in feedback mode,
  47. no pixels are produced by rasterization.
  48. Instead, information about primitives that would have been
  49. rasterized is fed back to the application using the GL.
  50. .P
  51. \%\f3glFeedbackBuffer\fP has three arguments:
  52. \f2buffer\fP is a pointer to an array of floating-point values
  53. into which feedback information is placed.
  54. \f2size\fP indicates the size of the array.
  55. \f2type\fP is a symbolic constant describing the information
  56. that is fed back for each vertex.
  57. \%\f3glFeedbackBuffer\fP must be issued before feedback mode is enabled
  58. (by calling \%\f3glRenderMode\fP with argument \%\f3GL_FEEDBACK\fP).
  59. Setting \%\f3GL_FEEDBACK\fP without establishing the feedback buffer,
  60. or calling \%\f3glFeedbackBuffer\fP while the GL is in feedback mode,
  61. is an error.
  62. .P
  63. When \%\f3glRenderMode\fP is called while in feedback mode, it returns the number of entries
  64. placed in the feedback array, and resets the feedback array pointer to the base
  65. of the feedback buffer. The returned value never exceeds \f2size\fP. If the feedback
  66. data required more room than was available in \f2buffer\fP,
  67. \%\f3glRenderMode\fP returns a negative value.
  68. To take the GL out of feedback mode, call
  69. \%\f3glRenderMode\fP with a parameter value other than \%\f3GL_FEEDBACK\fP.
  70. .P
  71. While in feedback mode,
  72. each primitive, bitmap, or pixel rectangle that would be rasterized
  73. generates a block of values that are copied into the feedback array.
  74. If doing so would cause the number of entries to exceed the maximum,
  75. the block is partially written so as to fill the array
  76. (if there is any room left at all),
  77. and an overflow flag is set.
  78. Each block begins with a code indicating the primitive type,
  79. followed by values that describe the primitive's vertices and
  80. associated data.
  81. Entries are also written for bitmaps and pixel rectangles.
  82. Feedback occurs after polygon culling and \%\f3glPolygonMode\fP interpretation
  83. of polygons has taken place,
  84. so polygons that are culled are not returned in the feedback buffer.
  85. It can also occur after polygons with more than three edges are broken up
  86. into triangles,
  87. if the GL implementation renders polygons by performing this decomposition.
  88. .P
  89. The \%\f3glPassThrough\fP command can be used to insert a marker
  90. into the feedback buffer.
  91. See \%\f3glPassThrough\fP.
  92. .P
  93. Following is the grammar for the blocks of values written
  94. into the feedback buffer.
  95. Each primitive is indicated with a unique identifying value
  96. followed by some number of vertices.
  97. Polygon entries include an integer value indicating how many vertices follow.
  98. A vertex is fed back as some number of floating-point values,
  99. as determined by \f2type\fP.
  100. Colors are fed back as four values in RGBA mode and one value
  101. in color index mode.
  102. .RS
  103. .na
  104. .sp
  105. feedbackList \(<- feedbackItem feedbackList | feedbackItem
  106. .sp
  107. feedbackItem \(<- point | lineSegment | polygon | bitmap | pixelRectangle | passThru
  108. .sp
  109. point \(<- \%\f3GL_POINT_TOKEN\fP vertex
  110. .sp
  111. lineSegment \(<- \%\f3GL_LINE_TOKEN\fP vertex vertex | \%\f3GL_LINE_RESET_TOKEN\fP vertex vertex
  112. .sp
  113. polygon \(<- \%\f3GL_POLYGON_TOKEN\fP n polySpec
  114. .sp
  115. polySpec \(<- polySpec vertex | vertex vertex vertex
  116. .sp
  117. bitmap \(<- \%\f3GL_BITMAP_TOKEN\fP vertex
  118. .sp
  119. pixelRectangle \(<- \%\f3GL_DRAW_PIXEL_TOKEN\fP vertex | \%\f3GL_COPY_PIXEL_TOKEN\fP vertex
  120. .sp
  121. passThru \(<- \%\f3GL_PASS_THROUGH_TOKEN\fP value
  122. .sp
  123. vertex \(<- 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture
  124. .sp
  125. 2d \(<- value value
  126. .sp
  127. 3d \(<- value value value
  128. .sp
  129. 3dColor \(<- value value value color
  130. .sp
  131. 3dColorTexture \(<- value value value color tex
  132. .sp
  133. 4dColorTexture \(<- value value value value color tex
  134. .sp
  135. color \(<- rgba | index
  136. .sp
  137. rgba \(<- value value value value
  138. .sp
  139. index \(<- value
  140. .sp
  141. tex \(<- value value value value
  142. .sp
  143. .RE
  144. .P
  145. .I value
  146. is a floating-point number,
  147. and
  148. .I n
  149. is a floating-point integer giving the number of vertices in the polygon.
  150. \%\f3GL_POINT_TOKEN\fP,
  151. \%\f3GL_LINE_TOKEN\fP,
  152. \%\f3GL_LINE_RESET_TOKEN\fP,
  153. \%\f3GL_POLYGON_TOKEN\fP,
  154. \%\f3GL_BITMAP_TOKEN\fP,
  155. \%\f3GL_DRAW_PIXEL_TOKEN\fP,
  156. \%\f3GL_COPY_PIXEL_TOKEN\fP and
  157. \%\f3GL_PASS_THROUGH_TOKEN\fP are symbolic floating-point constants.
  158. \%\f3GL_LINE_RESET_TOKEN\fP is returned whenever the line stipple pattern
  159. is reset.
  160. The data returned as a vertex depends on the feedback \f2type\fP.
  161. .P
  162. The following table gives the correspondence between \f2type\fP
  163. and the number of values per vertex.
  164. \f2k\fP is 1 in color index mode and 4 in RGBA mode.
  165. .sp
  166. .ne
  167. .TS
  168. center tab(:);
  169. lb lb cb cb cb
  170. l l c c c.
  171. _
  172. Type:Coordinates:Color:Texture:Total Number of Values
  173. _
  174. \%\f3GL_2D\fP:\f2x\fP, \f2y\fP:::2
  175. \%\f3GL_3D\fP:\f2x\fP, \f2y\fP, \f2z\fP:::3
  176. \%\f3GL_3D_COLOR\fP:\f2x\fP, \f2y\fP, \f2z\fP:$k$::$3 ~+~ k$
  177. \%\f3GL_3D_COLOR_TEXTURE\fP:\f2x\fP, \f2y\fP, \f2z\fP,:$k$:4:$7 ~+~ k$
  178. \%\f3GL_4D_COLOR_TEXTURE\fP:\f2x\fP, \f2y\fP, \f2z\fP, \f2w\fP:$k$:4:$8 ~+~ k$
  179. _
  180. .TE
  181. .P
  182. Feedback vertex coordinates are in window coordinates,
  183. except \f2w\fP,
  184. which is in clip coordinates.
  185. Feedback colors are lighted, if lighting is enabled.
  186. Feedback texture coordinates are generated,
  187. if texture coordinate generation is enabled.
  188. They are always transformed by the texture matrix.
  189. .SH NOTES
  190. \%\f3glFeedbackBuffer\fP, when used in a display list, is not compiled into the display list
  191. but is executed immediately.
  192. .P
  193. When the \%\f3GL_ARB_multitexture\fP extension is supported, \%\f3glFeedbackBuffer\fP
  194. returns only the texture coordinates of texture unit \%\f3GL_TEXTURE0_ARB\fP.
  195. .SH ERRORS
  196. \%\f3GL_INVALID_ENUM\fP is generated if \f2type\fP is not an accepted value.
  197. .P
  198. \%\f3GL_INVALID_VALUE\fP is generated if \f2size\fP is negative.
  199. .P
  200. \%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glFeedbackBuffer\fP is called while the
  201. render mode is \%\f3GL_FEEDBACK\fP,
  202. or if \%\f3glRenderMode\fP is called with argument \%\f3GL_FEEDBACK\fP before
  203. \%\f3glFeedbackBuffer\fP is called at least once.
  204. .P
  205. \%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glFeedbackBuffer\fP
  206. is executed between the execution of \%\f3glBegin\fP
  207. and the corresponding execution of \%\f3glEnd\fP.
  208. .SH ASSOCIATED GETS
  209. \%\f3glGet\fP with argument \%\f3GL_RENDER_MODE\fP
  210. .br
  211. \%\f3glGet\fP with argument \%\f3GL_FEEDBACK_BUFFER_POINTER\fP
  212. .br
  213. \%\f3glGet\fP with argument \%\f3GL_FEEDBACK_BUFFER_SIZE\fP
  214. .br
  215. \%\f3glGet\fP with argument \%\f3GL_FEEDBACK_BUFFER_TYPE\fP
  216. .SH SEE ALSO
  217. \%\f3glBegin(3G)\fP,
  218. \%\f3glLineStipple(3G)\fP,
  219. \%\f3glPassThrough(3G)\fP,
  220. \%\f3glPolygonMode(3G)\fP,
  221. \%\f3glRenderMode(3G)\fP,
  222. \%\f3glSelectBuffer(3G)\fP