| globjects 1.0.0.000000000000 Strict OpenGL objects wrapper.

Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
globjects::TransformFeedback Class Reference

Interface to use transform feedback. More...

`#include <globjects/include/globjects/TransformFeedback.h>`

Inheritance diagram for globjects::TransformFeedback:

## Public Member Functions
| TransformFeedback ()
virtual void | accept (ObjectVisitor &visitor) override
void | bind () const
void | begin (gl::GLenum primitiveMode)
void | pause ()
void | resume ()
void | end ()
void | draw (gl::GLenum primitiveMode) const
void | setVaryings (const Program *program, gl::GLsizei count, const char **varyingNames, gl::GLenum bufferMode)
void | setVaryings (const Program *program, const std::vector< std::string > &varyingNames, gl::GLenum bufferMode)
template<std::size_t Count>
void | setVaryings (const Program *program, const std::array< std::string, Count > &varyingNames, gl::GLenum bufferMode)
virtual gl::GLenum | objectType () const override
Public Member Functions inherited from globjects::Object
gl::GLuint | id () const
std::string | name () const
void | setName (const std::string &name)
bool | hasName () const
bool | isDefault () const
void | detach ()
Public Member Functions inherited from globjects::Referenced
| Referenced ()
void | ref () const
void | unref () const
int | refCounter () const
Public Member Functions inherited from globjects::HeapOnly
| HeapOnly ()
void | destroy () const

## Static Public Member Functions
static void | unbind ()
static bool | isTransformFeedback (gl::GLuint id)
Static Public Member Functions inherited from globjects::Object
static void | hintNameImplementation (NameImplementation impl)

## Protected Member Functions
virtual | ~TransformFeedback ()
void | bind (gl::GLenum target) const
Protected Member Functions inherited from globjects::Object
| Object (IDResource *resource)
virtual | ~Object ()
Protected Member Functions inherited from globjects::Referenced
virtual | ~Referenced ()
Protected Member Functions inherited from globjects::HeapOnly
virtual | ~HeapOnly ()

## Static Protected Member Functions
static void | unbind (gl::GLenum target)

## Additional Inherited Members
Public Types inherited from globjects::Object
enum | NameImplementation { NameImplementation::DebugKHR, NameImplementation::Legacy }
Protected Attributes inherited from globjects::Object
IDResource * | m_resource
void * | m_objectLabelState

## Detailed Description

Interface to use transform feedback.

The TransformFeedback methods map directly to their OpenGL function counterparts. The draw and setVaryings method additionally binds the TransformFeedback object, whereas the begin, pause, resume and end methods doesn't.

An example usage:

Program* program = createProgramIncludingShaders();
TransformFeedback* transformFeedback = new TransformFeedback();
Buffer* buffer = new Buffer(gl::GL_ARRAY_BUFFER);
transformFeedback->setVaryings(program, Array<const char*>{ "vertex_out" }, gl::GL_INTERLEAVED_ATTRIBS);
buffer->bindBase(gl::GL_TRANSFORM_FEEDBACK_BUFFER, 0);
buffer->setData(vertexSize, nullptr, gl::GL_DYNAMIC_DRAW);
program->use(); // use Program before issueing the begin method of TransformFeedback
transformFeedback->bind();
transformFeedback->begin(gl::GL_POINTS); // record point vertices
// draw calls
transformFeedback->end(); // stop recording vertices before releasing the Program
transformFeedback->unbind();
program->release();
// replay recorded vertices
transformFeeback->draw(gl::GL_POINTS);

See also
  http://www.opengl.org/registry/specs/EXT/transform_feedback.txt
  http://www.opengl.org/registry/specs/ARB/transform_feedback2.txt
  http://www.opengl.org/registry/specs/ARB/transform_feedback3.txt

## Constructor & Destructor Documentation

## ◆ TransformFeedback()

globjects::TransformFeedback::TransformFeedback | ( |  | ) |

## ◆ ~TransformFeedback()

virtual globjects::TransformFeedback::~TransformFeedback | ( |  | ) |
| protected virtual

## Member Function Documentation

## ◆ accept()

virtual void globjects::TransformFeedback::accept | ( | ObjectVisitor & | visitor | ) |
| override virtual

Implements globjects::Object.

## ◆ bind() [1/2]

void globjects::TransformFeedback::bind | ( |  | ) | const

## ◆ unbind() [1/2]

static void globjects::TransformFeedback::unbind | ( |  | ) |
| static

## ◆ begin()

void globjects::TransformFeedback::begin | ( | gl::GLenum | primitiveMode | ) |

## ◆ pause()

void globjects::TransformFeedback::pause | ( |  | ) |

## ◆ resume()

void globjects::TransformFeedback::resume | ( |  | ) |

## ◆ end()

void globjects::TransformFeedback::end | ( |  | ) |

## ◆ draw()

void globjects::TransformFeedback::draw | ( | gl::GLenum | primitiveMode | ) | const

## ◆ setVaryings() [1/3]

void globjects::TransformFeedback::setVaryings | ( | const Program * | program,
|  | gl::GLsizei | count,
|  | const char ** | varyingNames,
|  | gl::GLenum | bufferMode
| ) |  |

## ◆ setVaryings() [2/3]

void globjects::TransformFeedback::setVaryings | ( | const Program * | program,
|  | const std::vector< std::string > & | varyingNames,
|  | gl::GLenum | bufferMode
| ) |  |

## ◆ setVaryings() [3/3]

template<std::size_t Count>

void globjects::TransformFeedback::setVaryings | ( | const Program * | program,
|  | const std::array< std::string, Count > & | varyingNames,
|  | gl::GLenum | bufferMode
| ) |  |

## ◆ isTransformFeedback()

static bool globjects::TransformFeedback::isTransformFeedback | ( | gl::GLuint | id | ) |
| static

## ◆ objectType()

virtual gl::GLenum globjects::TransformFeedback::objectType | ( |  | ) | const
| override virtual

Implements globjects::Object.

## ◆ bind() [2/2]

void globjects::TransformFeedback::bind | ( | gl::GLenum | target | ) | const
| protected

## ◆ unbind() [2/2]

static void globjects::TransformFeedback::unbind | ( | gl::GLenum | target | ) |
| static protected

The documentation for this class was generated from the following file:

- TransformFeedback.h