<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:mml="http://www.w3.org/1998/Math/MathML"
><head><title>glFeedbackBuffer</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"/><link rel="home" href="index.xml" title="PyOpenGL 2.0.1.07 Man Pages"/><link rel="up" href="reference-GL.xml" title="GL"/><link rel="previous" href="glEvalPoint.3G.xml" title="glEvalPoint"/><link rel="next" href="glFinish.3G.xml" title="glFinish"/></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">glFeedbackBuffer</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glEvalPoint.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glFinish.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glFeedbackBuffer.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glFeedbackBuffer.3G-name"/><h2>Name</h2><p>glFeedbackBuffer &#8212; controls feedback mode</p></div><div class="refsynopsisdiv"><a name="glFeedbackBuffer.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>glFeedbackBuffer</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLsizei <i><tt>size</tt></i>, GLenum <i><tt>type</tt></i>, GLfloat *<i><tt>buffer</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glFeedbackBuffer.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glFeedbackBuffer</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>size</tt></i>, <i><tt>type</tt></i>) &#8594; <tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glFeedbackBuffer.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>size</tt></i></span></dt><dd>
						Specifies the maximum number of values that can be written into <i><tt>buffer</tt></i>.
					</dd><dt><span class="term"><i><tt>type</tt></i></span></dt><dd>
						Specifies a symbolic constant that describes the information that will be returned for each vertex.
						<tt>GL_2D</tt>, <tt>GL_3D</tt>, <tt>GL_3D_COLOR</tt>,
						<tt>GL_3D_COLOR_TEXTURE</tt>, and <tt>GL_4D_COLOR_TEXTURE</tt> are accepted.
					</dd><dt><span class="term"><i><tt>buffer</tt></i></span></dt><dd>
						Returns the feedback data.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glFeedbackBuffer.3G-description"/><h2>Description</h2><p>
			The <tt>glFeedbackBuffer</tt> function controls feedback. Feedback, like selection, is a GL mode. The mode
			is selected by calling <a href="glRenderMode.3G.xml"><tt>glRenderMode</tt></a> with <tt>GL_FEEDBACK</tt>.
			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.
		</p><p>
			<tt>glFeedbackBuffer</tt> has three arguments: <i><tt>buffer</tt></i> is a pointer to an array of
			floating-point values into which feedback information is placed. <i><tt>size</tt></i> indicates the size of the
			array. <i><tt>type</tt></i> is a symbolic constant describing the information that is fed back for each vertex.
			<tt>glFeedbackBuffer</tt> must be issued before feedback mode is enabled (by calling <a href="glRenderMode.3G.xml"><tt>glRenderMode</tt></a> with argument <tt>GL_FEEDBACK</tt>). Setting
			<tt>GL_FEEDBACK</tt> without establishing the feedback buffer, or calling
			<tt>glFeedbackBuffer</tt> while the GL is in feedback mode, is an error.
		</p><p>
			When <a href="glRenderMode.3G.xml"><tt>glRenderMode</tt></a> 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 <i><tt>size</tt></i>. If the feedback data required more room than was available in
			<i><tt>buffer</tt></i>, <a href="glRenderMode.3G.xml"><tt>glRenderMode</tt></a> returns a negative value. To take
			the GL out of feedback mode, call <a href="glRenderMode.3G.xml"><tt>glRenderMode</tt></a> with a parameter value other
			than <tt>GL_FEEDBACK</tt>.
		</p><p>
			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
			<a href="glPolygonMode.3G.xml"><tt>glPolygonMode</tt></a> 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.
		</p><p>
			The <a href="glPassThrough.3G.xml"><tt>glPassThrough</tt></a> command can be used to insert a marker into the feedback
			buffer. See <a href="glPassThrough.3G.xml"><tt>glPassThrough</tt></a>.
		</p><p>
			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
			<i><tt>type</tt></i>. Colors are fed back as four values in RGBA mode and one value in color index mode.
			feedbackList &#8592; feedbackItem feedbackList feedbackItem feedbackItem &#8592; point lineSegment polygon bitmap
			pixelRectangle passThru point &#8592; <tt>GL_POINT_TOKEN</tt> vertex lineSegment &#8592;
			<tt>GL_LINE_TOKEN</tt> vertex vertex <tt>GL_LINE_RESET_TOKEN</tt> vertex vertex polygon &#8592;
			<tt>GL_POLYGON_TOKEN</tt> n polySpec polySpec &#8592; polySpec vertex vertex vertex vertex bitmap &#8592;
			<tt>GL_BITMAP_TOKEN</tt> vertex pixelRectangle &#8592; <tt>GL_DRAW_PIXEL_TOKEN</tt> vertex
			<tt>GL_COPY_PIXEL_TOKEN</tt> vertex passThru &#8592; <tt>GL_PASS_THROUGH_TOKEN</tt> value vertex
			&#8592; 2d 3d 3dColor 3dColorTexture 4dColorTexture 2d &#8592; value value 3d &#8592; value value value 3dColor &#8592;
			value value value color 3dColorTexture &#8592; value value value color tex 4dColorTexture &#8592; value value value value
			color tex color &#8592; rgba index rgba &#8592; value value value value index &#8592; value tex &#8592; value value value
			value
		</p><p>
			<span class="emphasis"><em>value</em></span>is a floating-point number, and <span class="emphasis"><em>n</em></span>is a floating-point integer giving the
			number of vertices in the polygon. <tt>GL_POINT_TOKEN</tt>, <tt>GL_LINE_TOKEN</tt>,
			<tt>GL_LINE_RESET_TOKEN</tt>, <tt>GL_POLYGON_TOKEN</tt>, <tt>GL_BITMAP_TOKEN</tt>,
			<tt>GL_DRAW_PIXEL_TOKEN</tt>, <tt>GL_COPY_PIXEL_TOKEN</tt> and
			<tt>GL_PASS_THROUGH_TOKEN</tt> are symbolic floating-point constants.
			<tt>GL_LINE_RESET_TOKEN</tt> is returned whenever the line stipple pattern is reset. The data returned as a
			vertex depends on the feedback <i><tt>type</tt></i>.
		</p><p>
			The following table gives the correspondence between <i><tt>type</tt></i> and the number of values per vertex.
			<i><tt>k</tt></i> is 1 in color index mode and 4 in RGBA mode.
		</p><div class="informaltable"><table border="1"><colgroup><col/><col/><col/><col/><col/></colgroup><tbody><tr><td><span class="bold"><b>Type</b></span></td><td><span class="bold"><b>Coordinates</b></span></td><td align="center"><span class="bold"><b>Color</b></span></td><td align="center"><span class="bold"><b>Texture</b></span></td><td align="center"><span class="bold"><b>Total Number of Values</b></span></td></tr><tr><td><tt>GL_2D</tt></td><td><i><tt>x</tt></i>, <i><tt>y</tt></i></td><td align="center"> </td><td align="center"> </td><td align="center">2</td></tr><tr><td><tt>GL_3D</tt></td><td><i><tt>x</tt></i>, <i><tt>y</tt></i>, <i><tt>z</tt></i></td><td align="center"> </td><td align="center"> </td><td align="center">3</td></tr><tr><td><tt>GL_3D_COLOR</tt></td><td><i><tt>x</tt></i>, <i><tt>y</tt></i>, <i><tt>z</tt></i></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mi>k</mml:mi>
							</mml:math></td><td align="center"> </td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mrow>
									<mml:mn>3</mml:mn>
									<mml:mo>+</mml:mo>
									<mml:mi>k</mml:mi>
								</mml:mrow>
							</mml:math></td></tr><tr><td><tt>GL_3D_COLOR_TEXTURE</tt></td><td><i><tt>x</tt></i>, <i><tt>y</tt></i>, <i><tt>z</tt></i>,</td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mi>k</mml:mi>
							</mml:math></td><td align="center">4</td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mrow>
									<mml:mn>7</mml:mn>
									<mml:mo>+</mml:mo>
									<mml:mi>k</mml:mi>
								</mml:mrow>
							</mml:math></td></tr><tr><td><tt>GL_4D_COLOR_TEXTURE</tt></td><td><i><tt>x</tt></i>, <i><tt>y</tt></i>, <i><tt>z</tt></i>,
						<i><tt>w</tt></i></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mi>k</mml:mi>
							</mml:math></td><td align="center">4</td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mrow>
									<mml:mn>8</mml:mn>
									<mml:mo>+</mml:mo>
									<mml:mi>k</mml:mi>
								</mml:mrow>
							</mml:math></td></tr></tbody></table></div><p>
			Feedback vertex coordinates are in window coordinates, except <i><tt>w</tt></i>, 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.
		</p></div><div class="refsect1" lang="en"><a name="glFeedbackBuffer.3G-notes"/><h2>Notes</h2><p>
			<tt>glFeedbackBuffer</tt>, when used in a display list, is not compiled into the display list but is
			executed immediately.
		</p><p>
			When the <tt>GL_ARB_multitexture</tt> extension is supported, <tt>glFeedbackBuffer</tt> returns
			only the texture coordinates of texture unit <tt>GL_TEXTURE0_ARB</tt>.
		</p></div><div class="refsect1" lang="en"><a name="glFeedbackBuffer.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>type</tt></i> is not an accepted value.
		</p><p>
			<tt>GL_INVALID_VALUE</tt> is generated if <i><tt>size</tt></i> is negative.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glFeedbackBuffer</tt> is called while the
			render mode is <tt>GL_FEEDBACK</tt>, or if <a href="glRenderMode.3G.xml"><tt>glRenderMode</tt></a> is called
			with argument <tt>GL_FEEDBACK</tt> before <tt>glFeedbackBuffer</tt> is called at least once.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glFeedbackBuffer</tt> is executed between the
			execution of <a href="glBegin.3G.xml"><tt>glBegin</tt></a> and the corresponding execution of <a href="glBegin.3G.xml"><tt>glEnd</tt></a>.
		</p></div><div class="refsect1" lang="en"><a name="glFeedbackBuffer.3G-associated_gets"/><h2>Associated Gets</h2><p>
			<tt>glGet</tt> with argument <tt>GL_RENDER_MODE</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_FEEDBACK_BUFFER_POINTER</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_FEEDBACK_BUFFER_SIZE</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_FEEDBACK_BUFFER_TYPE</tt>
		</p></div><div class="refsect1" lang="en"><a name="glFeedbackBuffer.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist"><a href="glBegin.3G.xml">glBegin</a>, <a href="glLineStipple.3G.xml">glLineStipple</a>, <a href="glPassThrough.3G.xml">glPassThrough</a>, <a href="glPolygonMode.3G.xml">glPolygonMode</a>, <a href="glRenderMode.3G.xml">glRenderMode</a>, <a href="glSelectBuffer.3G.xml">glSelectBuffer</a></span>
		</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="glEvalPoint.3G.xml">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-GL.xml">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="glFinish.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glEvalPoint </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glFinish</td></tr></table></div></body></html>
