1GLFEEDBACKBUFFER(3G) OpenGL Manual GLFEEDBACKBUFFER(3G)
2
3
4
6 glFeedbackBuffer - controls feedback mode
7
9 void glFeedbackBuffer(GLsizei size, GLenum type, GLfloat * buffer);
10
12 size
13 Specifies the maximum number of values that can be written into
14 buffer.
15
16 type
17 Specifies a symbolic constant that describes the information that
18 will be returned for each vertex. GL_2D, GL_3D, GL_3D_COLOR,
19 GL_3D_COLOR_TEXTURE, and GL_4D_COLOR_TEXTURE are accepted.
20
21 buffer
22 Returns the feedback data.
23
25 The glFeedbackBuffer function controls feedback. Feedback, like
26 selection, is a GL mode. The mode is selected by calling glRenderMode()
27 with GL_FEEDBACK. When the GL is in feedback mode, no pixels are
28 produced by rasterization. Instead, information about primitives that
29 would have been rasterized is fed back to the application using the GL.
30
31 glFeedbackBuffer has three arguments: buffer is a pointer to an array
32 of floating-point values into which feedback information is placed.
33 size indicates the size of the array. type is a symbolic constant
34 describing the information that is fed back for each vertex.
35 glFeedbackBuffer must be issued before feedback mode is enabled (by
36 calling glRenderMode() with argument GL_FEEDBACK). Setting GL_FEEDBACK
37 without establishing the feedback buffer, or calling glFeedbackBuffer
38 while the GL is in feedback mode, is an error.
39
40 When glRenderMode() is called while in feedback mode, it returns the
41 number of entries placed in the feedback array and resets the feedback
42 array pointer to the base of the feedback buffer. The returned value
43 never exceeds size. If the feedback data required more room than was
44 available in buffer, glRenderMode() returns a negative value. To take
45 the GL out of feedback mode, call glRenderMode() with a parameter value
46 other than GL_FEEDBACK.
47
48 While in feedback mode, each primitive, bitmap, or pixel rectangle that
49 would be rasterized generates a block of values that are copied into
50 the feedback array. If doing so would cause the number of entries to
51 exceed the maximum, the block is partially written so as to fill the
52 array (if there is any room left at all), and an overflow flag is set.
53 Each block begins with a code indicating the primitive type, followed
54 by values that describe the primitive's vertices and associated data.
55 Entries are also written for bitmaps and pixel rectangles. Feedback
56 occurs after polygon culling and glPolygonMode() interpretation of
57 polygons has taken place, so polygons that are culled are not returned
58 in the feedback buffer. It can also occur after polygons with more than
59 three edges are broken up into triangles, if the GL implementation
60 renders polygons by performing this decomposition.
61
62 The glPassThrough() command can be used to insert a marker into the
63 feedback buffer. See glPassThrough().
64
65 Following is the grammar for the blocks of values written into the
66 feedback buffer. Each primitive is indicated with a unique identifying
67 value followed by some number of vertices. Polygon entries include an
68 integer value indicating how many vertices follow. A vertex is fed back
69 as some number of floating-point values, as determined by type. Colors
70 are fed back as four values in RGBA mode and one value in color index
71 mode.
72
73 value is a floating-point number, and n is a floating-point integer
74 giving the number of vertices in the polygon. GL_POINT_TOKEN,
75 GL_LINE_TOKEN, GL_LINE_RESET_TOKEN, GL_POLYGON_TOKEN, GL_BITMAP_TOKEN,
76 GL_DRAW_PIXEL_TOKEN, GL_COPY_PIXEL_TOKEN and GL_PASS_THROUGH_TOKEN are
77 symbolic floating-point constants. GL_LINE_RESET_TOKEN is returned
78 whenever the line stipple pattern is reset. The data returned as a
79 vertex depends on the feedback type.
80
81 The following table gives the correspondence between type and the
82 number of values per vertex. k is 1 in color index mode and 4 in RGBA
83 mode.
84
85 ┌─────────────────────────────┬─────────────────────────────────────┬───────────────────────────────┬─────────────────────────────────┬───────────────────────────────────┐
86 │ │ │ │ │ │
87 │ Type │ Coordinates │ Color │ Texture │ Total │
88 │ │ │ │ │ Number of │
89 │ │ │ │ │ Values │
90 │ │ │ │ │ │
91 ├─────────────────────────────┼─────────────────────────────────────┼───────────────────────────────┼─────────────────────────────────┼───────────────────────────────────┤
92 │GL_2D │ x, y │ │ │ 2 │
93 ├─────────────────────────────┼─────────────────────────────────────┼───────────────────────────────┼─────────────────────────────────┼───────────────────────────────────┤
94 │GL_3D │ x, y, z │ │ │ 3 │
95 ├─────────────────────────────┼─────────────────────────────────────┼───────────────────────────────┼─────────────────────────────────┼───────────────────────────────────┤
96 │GL_3D_COLOR │ x, y, z │ k │ │ 3 │
97 │ │ │ │ │ + │
98 │ │ │ │ │ k │
99 ├─────────────────────────────┼─────────────────────────────────────┼───────────────────────────────┼─────────────────────────────────┼───────────────────────────────────┤
100 │GL_3D_COLOR_TEXTURE │ x, y, z │ k │ 4 │ 7 │
101 │ │ │ │ │ + │
102 │ │ │ │ │ k │
103 ├─────────────────────────────┼─────────────────────────────────────┼───────────────────────────────┼─────────────────────────────────┼───────────────────────────────────┤
104 │GL_4D_COLOR_TEXTURE │ x, y, z, w │ k │ 4 │ 8 │
105 │ │ │ │ │ + │
106 │ │ │ │ │ k │
107 └─────────────────────────────┴─────────────────────────────────────┴───────────────────────────────┴─────────────────────────────────┴───────────────────────────────────┘
108
109 Feedback vertex coordinates are in window coordinates, except w, which
110 is in clip coordinates. Feedback colors are lighted, if lighting is
111 enabled. Feedback texture coordinates are generated, if texture
112 coordinate generation is enabled. They are always transformed by the
113 texture matrix.
114
116 glFeedbackBuffer, when used in a display list, is not compiled into the
117 display list but is executed immediately.
118
119 glFeedbackBuffer returns only the texture coordinate of texture unit
120 GL_TEXTURE0.
121
123 GL_INVALID_ENUM is generated if type is not an accepted value.
124
125 GL_INVALID_VALUE is generated if size is negative.
126
127 GL_INVALID_OPERATION is generated if glFeedbackBuffer is called while
128 the render mode is GL_FEEDBACK, or if glRenderMode() is called with
129 argument GL_FEEDBACK before glFeedbackBuffer is called at least once.
130
131 GL_INVALID_OPERATION is generated if glFeedbackBuffer is executed
132 between the execution of glBegin() and the corresponding execution of
133 glEnd().
134
136 glGet() with argument GL_RENDER_MODE
137
138 glGet() with argument GL_FEEDBACK_BUFFER_POINTER
139
140 glGet() with argument GL_FEEDBACK_BUFFER_SIZE
141
142 glGet() with argument GL_FEEDBACK_BUFFER_TYPE
143
145 glBegin(), glLineStipple(), glPassThrough(), glPolygonMode(),
146 glRenderMode(), glSelectBuffer()
147
149 Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
150 under the SGI Free Software B License. For details, see
151 http://oss.sgi.com/projects/FreeB/.
152
154 opengl.org
155
156
157
158opengl.org 07/13/2018 GLFEEDBACKBUFFER(3G)