glBeginTransformFeedback - OpenGL ES 3 Reference Pages

## Name

glBeginTransformFeedback — start transform feedback operation

## C Specification

`void glBeginTransformFeedback(` | GLenum primitiveMode`)`;

`void glEndTransformFeedback(` | void`)`;

## Parameters for `glBeginTransformFeedback`

`primitiveMode`

  Specify the output type of the primitives that will be recorded into the buffer objects that are bound for transform feedback.

## Description

Transform feedback mode captures the values of varying variables written by the vertex shader. Transform feedback is said to be active after a call to `glBeginTransformFeedback` until a subsequent call to `glEndTransformFeedback`. Transform feedback commands must be paired. An implicit glResumeTransformFeedback is performed by `glEndTransformFeedback` if the transform feedback is paused. Transform feedback is restricted to non-indexed `GL_POINTS`, `GL_LINES`, and `GL_TRIANGLES`.

While transform feedback is active the `mode` parameter to glDrawArrays must exactly match the `primitiveMode` specified by `glBeginTransformFeedback`.

## Errors

`GL_INVALID_OPERATION` is generated if `glBeginTransformFeedback` is executed while transform feedback is active.

`GL_INVALID_ENUM` is generated by `glBeginTransformFeedback` if `primitiveMode` is not one of `GL_POINTS`, `GL_LINES`, or `GL_TRIANGLES`.

`GL_INVALID_OPERATION` is generated if `glEndTransformFeedback` is executed while transform feedback is not active.

`GL_INVALID_OPERATION` is generated by glDrawArrays and glDrawArraysInstanced if transform feedback is active and `mode` does not exactly match `primitiveMode`.

`GL_INVALID_OPERATION` is generated by glDrawElements, glDrawElementsInstanced, and glDrawRangeElements if transform feedback is active and not paused.

`GL_INVALID_OPERATION` is generated by `glBeginTransformFeedback` if any binding point used in transform feedback mode does not have a buffer object bound. In interleaved mode, only the first buffer object binding point is ever written to.

`GL_INVALID_OPERATION` is generated by `glBeginTransformFeedback` if no binding points would be used, either because no program object is active of because the active program object has specified no varying variables to record.

## API Version Support

| OpenGL ES API Version
--- | ---
Function Name | 2.0 | 3.0
`glBeginTransformFeedback` | - | ✔
`glEndTransformFeedback` | - | ✔

## See Also

glPauseTransformFeedback, glResumeTransformFeedback

## Copyright

Copyright © 2010-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.