A set of Buffer objects to collect the result of a transform feedback. More...
#include <TransformFeedback.h>
Public Member Functions | |
TransformFeedback () | |
Creates a new TransformFeedback object. | |
virtual | ~TransformFeedback () |
Deletes this TransformFeedback object. | |
void | reset () |
Removes all the buffers associated with this object. | |
void | setVertexBuffer (int index, ptr< GPUBuffer > b) |
Attachs the given GPUBuffer to collect the transformed output varying of the given index. | |
void | setVertexBuffer (int index, ptr< GPUBuffer > b, GLuint offset, GLuint size) |
Attachs the given GPUBuffer to collect the transformed output varying of the given index. | |
void | transformFeedback (const TransformFeedback &tfb, int stream=0) |
Retransforms a mesh resulting from a previous transform feedback session. | |
Static Public Member Functions | |
static ptr< TransformFeedback > | getDefault () |
Returns the default TransformFeedback instance. | |
static void | begin (ptr< FrameBuffer > fb, ptr< Program > transform, MeshMode m, ptr< TransformFeedback > tfb, bool rasterize) |
Starts a transform feedback session. | |
static void | transform (const MeshBuffers &mesh, GLint first, GLsizei count, GLsizei primCount=1, GLint base=0) |
Transforms a part of a mesh one or more times. | |
static void | multiTransform (const MeshBuffers &mesh, GLint *firsts, GLsizei *counts, GLsizei primCount, GLint *bases=0) |
Transforms several parts of a mesh. | |
static void | transformIndirect (const MeshBuffers &mesh, const Buffer &buf) |
Transforms a part of a mesh one or more times. | |
static void | pause () |
Pauses the current transform feedback session. | |
static void | resume (ptr< TransformFeedback > tfb) |
Resumes the current transform feedback session. | |
static void | end () |
Ends the current transform feedback session. |
A set of Buffer objects to collect the result of a transform feedback.
In OpenGL 3.3 only a single TransformFeedback instance can be used, the one returned by::getDefault. With OpenGL 4 other instances can be used, which can be created with the constructor. In any case, only one transform feedback can be performed at a time, with the static begin, transform and end methods.
ork::TransformFeedback::TransformFeedback | ( | ) |
Creates a new TransformFeedback object.
Only works with OpenGL 4.0 or more.
virtual ork::TransformFeedback::~TransformFeedback | ( | ) | [virtual] |
Deletes this TransformFeedback object.
static void ork::TransformFeedback::begin | ( | ptr< FrameBuffer > | fb, | |
ptr< Program > | transform, | |||
MeshMode | m, | |||
ptr< TransformFeedback > | tfb, | |||
bool | rasterize | |||
) | [static] |
Starts a transform feedback session.
Actual transforms are performed with the transform methods. The transformation is ended with the end() method. In OpenGL 4.0, pause and resume can be called between begin() and end(), for instance to change the TransformFeedback instance used to record the varyings.
fb | the framebuffer to use for this session. | |
transform | the program to use for this session. | |
m | how the mesh vertices must be interpreted in transform methods. | |
tfb | the set of buffers to use to store the results of the session, i.e., the transformed output varying variables. | |
rasterize | true to rasterize the transformed primitives, or false to disable the rasterization stage during this session. |
static void ork::TransformFeedback::end | ( | ) | [static] |
Ends the current transform feedback session.
static ptr<TransformFeedback> ork::TransformFeedback::getDefault | ( | ) | [static] |
Returns the default TransformFeedback instance.
static void ork::TransformFeedback::multiTransform | ( | const MeshBuffers & | mesh, | |
GLint * | firsts, | |||
GLsizei * | counts, | |||
GLsizei | primCount, | |||
GLint * | bases = 0 | |||
) | [static] |
Transforms several parts of a mesh.
Each part is specified with a first and count parameter as in transform(). These values are passed in arrays of primCount values.
mesh | the mesh to transform. | |
firsts | an array of primCount 'first vertex' to draw, or an array of 'first indice' to draw if this mesh has indices. | |
counts | an array of number of vertices to draw, or an array of number of indices to draw if this mesh has indices. | |
primCount | the number of parts of this mesh to draw. | |
bases | the base vertices to use. Only used for meshes with indices. |
static void ork::TransformFeedback::pause | ( | ) | [static] |
Pauses the current transform feedback session.
Only available with OpenGL 4.0 or more.
void ork::TransformFeedback::reset | ( | ) |
Removes all the buffers associated with this object.
static void ork::TransformFeedback::resume | ( | ptr< TransformFeedback > | tfb | ) | [static] |
Resumes the current transform feedback session.
Only available with OpenGL 4.0 or more.
tfb | the set of buffers to use to store the results of the session, i.e., the transformed output varying variables. |
void ork::TransformFeedback::setVertexBuffer | ( | int | index, | |
ptr< GPUBuffer > | b, | |||
GLuint | offset, | |||
GLuint | size | |||
) |
Attachs the given GPUBuffer to collect the transformed output varying of the given index.
index | the index of a recorded output varying variable. | |
b | the GPUBuffer to use to store the recorded values of this varying. | |
offset | the offset at which the first recorded value must be stored. | |
size | the maximum size of the recorded values. |
static void ork::TransformFeedback::transform | ( | const MeshBuffers & | mesh, | |
GLint | first, | |||
GLsizei | count, | |||
GLsizei | primCount = 1 , |
|||
GLint | base = 0 | |||
) | [static] |
Transforms a part of a mesh one or more times.
mesh | the mesh to transform. | |
first | the first vertex to draw, or the first indice to draw if this mesh has indices. | |
count | the number of vertices to draw, or the number of indices to draw if this mesh has indices. | |
primCount | the number of times this mesh must be drawn (with geometry instancing). | |
base | the base vertex to use. Only used for meshes with indices. |
void ork::TransformFeedback::transformFeedback | ( | const TransformFeedback & | tfb, | |
int | stream = 0 | |||
) |
Retransforms a mesh resulting from a previous transform feedback session.
Only available with OpenGL 4.0 or more.
tfb | a TransformFeedback containing the results of a previous transform feedback session. | |
stream | the stream to draw. |
static void ork::TransformFeedback::transformIndirect | ( | const MeshBuffers & | mesh, | |
const Buffer & | buf | |||
) | [static] |
Transforms a part of a mesh one or more times.
mesh | the mesh to transform. | |
buf | a CPU or GPU buffer containing the 'count', 'primCount', 'first' and 'base' parameters, in this order, as 32 bit integers. |