class
#include <Magnum/GL/TransformFeedback.h>
TransformFeedback Transform feedback.
Performance optimizations
The engine tracks currently bound transform feedback to avoid unnecessary calls to glBindTransformFeedback(). Transform feedback limits and implementation-defined values (such as maxSeparateComponents()) are cached, so repeated queries don't result in repeated glGet() calls. See also Context::
If ARB_
Base classes
- class AbstractObject
- Base for all OpenGL objects.
Public types
- enum class PrimitiveMode: GLenum { Points = GL_POINTS, Lines = GL_LINES, Triangles = GL_TRIANGLES }
- Transform feedback primitive mode.
Public static functions
- static auto maxInterleavedComponents() -> Int
- Max supported interleaved component count.
- static auto maxSeparateAttributes() -> Int
- Max supported separate attribute count.
- static auto maxSeparateComponents() -> Int
- Max supported separate component count.
- static auto maxBuffers() -> Int
- Max supported buffer count.
- static auto maxVertexStreams() -> Int
- Max supported vertex stream count.
- static auto wrap(GLuint id, ObjectFlags flags = {}) -> TransformFeedback
- Wrap existing OpenGL transform feedback object.
Constructors, destructors, conversion operators
- TransformFeedback() explicit
- Constructor.
- TransformFeedback(NoCreateT) explicit noexcept
- Construct without creating the underlying OpenGL object.
- TransformFeedback(const TransformFeedback&) deleted
- Copying is not allowed.
- TransformFeedback(TransformFeedback&& other) noexcept
- Move constructor.
- ~TransformFeedback()
- Destructor.
Public functions
- auto operator=(const TransformFeedback&) -> TransformFeedback& deleted
- Copying is not allowed.
- auto operator=(TransformFeedback&& other) -> TransformFeedback& noexcept
- Move assignment.
- auto id() const -> GLuint
- OpenGL transform feedback ID.
- auto release() -> GLuint
- Release OpenGL object.
-
auto label() -> Containers::
String - Transform feedback label.
-
auto setLabel(Containers::
StringView label) -> TransformFeedback& - Set transform feedback label.
- auto attachBuffer(UnsignedInt index, Buffer& buffer, GLintptr offset, GLsizeiptr size) -> TransformFeedback&
- Attach range of buffer.
- auto attachBuffer(UnsignedInt index, Buffer& buffer) -> TransformFeedback&
- Attach buffer.
-
auto attachBuffers(UnsignedInt firstIndex,
Containers::
ArrayView<const Containers:: Triple<Buffer*, GLintptr, GLsizeiptr>> buffers) -> TransformFeedback& new in Git master - Attach ranges of buffers.
-
auto attachBuffers(UnsignedInt firstIndex,
std::
initializer_list<Containers:: Triple<Buffer*, GLintptr, GLsizeiptr>> buffers) -> TransformFeedback& new in Git master -
auto attachBuffers(UnsignedInt firstIndex,
Containers::
ArrayView<Buffer*const> buffers) -> TransformFeedback& new in Git master - Attach buffers.
-
auto attachBuffers(UnsignedInt firstIndex,
std::
initializer_list<Buffer*> buffers) -> TransformFeedback& - void begin(AbstractShaderProgram& shader, PrimitiveMode mode)
- Begin transform feedback.
- void pause()
- Pause transform feedback.
- void resume()
- Resume transform feedback.
- void end()
- End transform feedback.
Enum documentation
enum class Magnum:: GL:: TransformFeedback:: PrimitiveMode: GLenum
Transform feedback primitive mode.
Enumerators | |
---|---|
Points |
Points. If no geometry shader is present, allowed only in combination with MeshPrimitive:: |
Lines |
Lines. If no geometry shader is present, allowed only in combination with MeshPrimitive:: |
Triangles |
Triangles. If no geometry shader is present, allowed only in combination with MeshPrimitive:: |
Function documentation
static Int Magnum:: GL:: TransformFeedback:: maxInterleavedComponents()
Max supported interleaved component count.
The result is cached, repeated queries don't result in repeated OpenGL calls. If extension EXT_0
.
static Int Magnum:: GL:: TransformFeedback:: maxSeparateAttributes()
Max supported separate attribute count.
The result is cached, repeated queries don't result in repeated OpenGL calls. If extension EXT_0
.
static Int Magnum:: GL:: TransformFeedback:: maxSeparateComponents()
Max supported separate component count.
The result is cached, repeated queries don't result in repeated OpenGL calls. If extension EXT_0
.
static Int Magnum:: GL:: TransformFeedback:: maxBuffers()
Max supported buffer count.
The result is cached, repeated queries don't result in repeated OpenGL calls. If extension ARB_
static Int Magnum:: GL:: TransformFeedback:: maxVertexStreams()
Max supported vertex stream count.
The result is cached, repeated queries don't result in repeated OpenGL calls. If extension ARB_1
.
static TransformFeedback Magnum:: GL:: TransformFeedback:: wrap(GLuint id,
ObjectFlags flags = {})
Wrap existing OpenGL transform feedback object.
Parameters | |
---|---|
id | OpenGL transform feedback ID |
flags | Object creation flags |
The id
is expected to be of an existing OpenGL transform feedback object. Unlike renderbuffer created using constructor, the OpenGL object is by default not deleted on destruction, use flags
for different behavior.
Magnum:: GL:: TransformFeedback:: TransformFeedback() explicit
Constructor.
Creates new OpenGL transform feedback object. If ARB_
Magnum:: GL:: TransformFeedback:: TransformFeedback(NoCreateT) explicit noexcept
Construct without creating the underlying OpenGL object.
The constructed instance is equivalent to moved-from state. Useful in cases where you will overwrite the instance later anyway. Move another object over it to make it useful.
This function can be safely used for constructing (and later destructing) objects even without any OpenGL context being active. However note that this is a low-level and a potentially dangerous API, see the documentation of NoCreate for alternatives.
Magnum:: GL:: TransformFeedback:: ~TransformFeedback()
Destructor.
Deletes associated OpenGL transform feedback object.
GLuint Magnum:: GL:: TransformFeedback:: release()
Release OpenGL object.
Releases ownership of OpenGL transform feedback object and returns its ID so it is not deleted on destruction. The internal state is then equivalent to moved-from state.
Containers:: String Magnum:: GL:: TransformFeedback:: label()
Transform feedback label.
The result is not cached, repeated queries will result in repeated OpenGL calls. If OpenGL 4.3 / OpenGL ES 3.2 is not supported and neither KHR_
TransformFeedback& Magnum:: GL:: TransformFeedback:: setLabel(Containers:: StringView label)
Set transform feedback label.
Returns | Reference to self (for method chaining) |
---|
Default is empty string. If OpenGL 4.3 / OpenGL ES 3.2 is not supported and neither KHR_
TransformFeedback& Magnum:: GL:: TransformFeedback:: attachBuffer(UnsignedInt index,
Buffer& buffer,
GLintptr offset,
GLsizeiptr size)
Attach range of buffer.
Returns | Reference to self (for method chaining) |
---|
The offset
parameter must be aligned to 4 bytes. If ARB_
TransformFeedback& Magnum:: GL:: TransformFeedback:: attachBuffer(UnsignedInt index,
Buffer& buffer)
Attach buffer.
Returns | Reference to self (for method chaining) |
---|
If ARB_
TransformFeedback& Magnum:: GL:: TransformFeedback:: attachBuffers(UnsignedInt firstIndex,
Containers:: ArrayView<const Containers:: Triple<Buffer*, GLintptr, GLsizeiptr>> buffers) new in Git master
Attach ranges of buffers.
Returns | Reference to self (for method chaining) |
---|
Attches first buffer in the list to firstIndex
, second to firstIndex + 1
etc. Second parameter is offset, third is size. If any buffer is nullptr
, given attachment point is detached. The range of indices must respect maxBuffers() (maxSeparateComponents() in OpenGL ES or if ARB_
TransformFeedback& Magnum:: GL:: TransformFeedback:: attachBuffers(UnsignedInt firstIndex,
std:: initializer_list<Containers:: Triple<Buffer*, GLintptr, GLsizeiptr>> buffers) new in Git master
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
TransformFeedback& Magnum:: GL:: TransformFeedback:: attachBuffers(UnsignedInt firstIndex,
Containers:: ArrayView<Buffer*const> buffers) new in Git master
Attach buffers.
Returns | Reference to self (for method chaining) |
---|
Attches first buffer in the list to firstIndex
, second to firstIndex + 1
etc. If any buffer is nullptr
, given index is detached. The range of indices must respect maxBuffers() (maxSeparateComponents() in OpenGL ES or if ARB_
TransformFeedback& Magnum:: GL:: TransformFeedback:: attachBuffers(UnsignedInt firstIndex,
std:: initializer_list<Buffer*> buffers)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Magnum:: GL:: TransformFeedback:: begin(AbstractShaderProgram& shader,
PrimitiveMode mode)
Begin transform feedback.
Parameters | |
---|---|
shader | Shader from which to capture data |
mode | Primitive mode |
When transform feedback is active, only shader given in shader
and meshes with primitive type (or geometry shaders with output primitive type) compatible with mode
can be used. Only one transform feedback object can be active at a time.
void Magnum:: GL:: TransformFeedback:: pause()
Pause transform feedback.
Pausing transform feedback makes it inactive, allowing to use different shader, or starting another transform feedback.
void Magnum:: GL:: TransformFeedback:: end()
End transform feedback.
Ends transform feedback so the captured data can be used.