Class ARBTransformFeedback2
The EXT_transform_feedback extension allows applications to capture primitives to one or more buffer objects when transformed by the GL. This
extension provides a few additional capabilities to these extensions, making transform feedback mode more useful.
First, it provides transform feedback objects which encapsulate transform feedback-related state, allowing applications to replace the entire transform feedback configuration in a single bind call. Second, it provides the ability to pause and resume transform feedback operations. When transform feedback is paused, applications may render without transform feedback or may use transform feedback with different state and a different transform feedback object. When transform feedback is resumed, additional primitives are captured and appended to previously captured primitives for the object.
Additionally, this extension provides the ability to draw primitives captured in transform feedback mode without querying the captured primitive count.
The command DrawTransformFeedback is equivalent to glDrawArrays(<mode>, 0, <count>), where count is the number of
vertices captured to buffer objects during the last transform feedback capture operation on the transform feedback object used. This draw operation
only provides a vertex count -- it does not automatically set up vertex array state or vertex buffer object bindings, which must be done separately by
the application.
Requires GL20 or ARB_shader_objects and NV_transform_feedback or EXT_transform_feedback.
Promoted to core in OpenGL 4.0.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAccepted by thetargetparameter of BindTransformFeedback.static final intAccepted by thepnameparameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv.static final intAccepted by thepnameparameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv.static final intAccepted by thepnameparameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidglBindTransformFeedback(int target, int id) Binds a transform feedback object.static voidglDeleteTransformFeedbacks(int id) Deletes transform feedback objects.static voidglDeleteTransformFeedbacks(int[] ids) Array version of:DeleteTransformFeedbacksstatic voidDeletes transform feedback objects.static voidglDrawTransformFeedback(int mode, int id) Render primitives using a count derived from a transform feedback object.static intReserves transform feedback object names.static voidglGenTransformFeedbacks(int[] ids) Array version of:GenTransformFeedbacksstatic voidReserves transform feedback object names.static booleanglIsTransformFeedback(int id) Determines if a name corresponds to a transform feedback object.static voidPauses transform feedback operations for the currently bound transform feedback object.static voidResumes transform feedback operations for the currently bound transform feedback object.static voidnglDeleteTransformFeedbacks(int n, long ids) Unsafe version of:DeleteTransformFeedbacksstatic voidnglGenTransformFeedbacks(int n, long ids) Unsafe version of:GenTransformFeedbacks
-
Field Details
-
GL_TRANSFORM_FEEDBACK
public static final int GL_TRANSFORM_FEEDBACKAccepted by thetargetparameter of BindTransformFeedback.- See Also:
-
GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED
public static final int GL_TRANSFORM_FEEDBACK_BUFFER_PAUSEDAccepted by thepnameparameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv.- See Also:
-
GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE
public static final int GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVEAccepted by thepnameparameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv.- See Also:
-
GL_TRANSFORM_FEEDBACK_BINDING
public static final int GL_TRANSFORM_FEEDBACK_BINDINGAccepted by thepnameparameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv.- See Also:
-
-
Method Details
-
glBindTransformFeedback
public static void glBindTransformFeedback(int target, int id) Binds a transform feedback object.- Parameters:
target- the target to which to bind the transform feedback objectid. Must be:TRANSFORM_FEEDBACKid- the name of a transform feedback object
-
nglDeleteTransformFeedbacks
public static void nglDeleteTransformFeedbacks(int n, long ids) Unsafe version of:DeleteTransformFeedbacks- Parameters:
n- the number of transform feedback objects to delete
-
glDeleteTransformFeedbacks
Deletes transform feedback objects.- Parameters:
ids- an array of names of transform feedback objects to delete
-
glDeleteTransformFeedbacks
public static void glDeleteTransformFeedbacks(int id) Deletes transform feedback objects. -
nglGenTransformFeedbacks
public static void nglGenTransformFeedbacks(int n, long ids) Unsafe version of:GenTransformFeedbacks- Parameters:
n- the number of transform feedback object names to reserve
-
glGenTransformFeedbacks
Reserves transform feedback object names.- Parameters:
ids- an array of into which the reserved names will be written
-
glGenTransformFeedbacks
public static int glGenTransformFeedbacks()Reserves transform feedback object names. -
glIsTransformFeedback
public static boolean glIsTransformFeedback(int id) Determines if a name corresponds to a transform feedback object.- Parameters:
id- a value that may be the name of a transform feedback object
-
glPauseTransformFeedback
public static void glPauseTransformFeedback()Pauses transform feedback operations for the currently bound transform feedback object.When transform feedback operations are paused, transform feedback is still considered active and changing most transform feedback state related to the object results in an error. However, a new transform feedback object may be bound while transform feedback is paused. The error
INVALID_OPERATIONis generated by PauseTransformFeedback if the currently bound transform feedback is not active or is paused.When transform feedback is active and not paused, all geometric primitives generated must be compatible with the value of
primitiveModepassed toBeginTransformFeedback. The errorINVALID_OPERATIONis generated byBeginor any operation that implicitly callsBegin(such asDrawElements) ifmodeis not one of the allowed modes. If a geometry shader is active, its output primitive type is used instead of themodeparameter passed toBeginfor the purposes of this error check. Any primitive type may be used while transform feedback is paused. -
glResumeTransformFeedback
public static void glResumeTransformFeedback()Resumes transform feedback operations for the currently bound transform feedback object.The error
INVALID_OPERATIONis generated byResumeTransformFeedbackif the currently bound transform feedback is not active or is not paused. -
glDrawTransformFeedback
public static void glDrawTransformFeedback(int mode, int id) Render primitives using a count derived from a transform feedback object.- Parameters:
mode- what kind of primitives to render. One of:POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLESLINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADSQUAD_STRIPid- the name of a transform feedback object from which to retrieve a primitive count
-
glDeleteTransformFeedbacks
public static void glDeleteTransformFeedbacks(int[] ids) Array version of:DeleteTransformFeedbacks -
glGenTransformFeedbacks
public static void glGenTransformFeedbacks(int[] ids) Array version of:GenTransformFeedbacks
-