globjects  1.1.0.2f0c753c8647
Strict OpenGL objects wrapper.

Interface to use transform feedback. More...

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

Inheritance diagram for globjects::TransformFeedback:
globjects::Object globjects::Referenced globjects::HeapOnly

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

globjects::TransformFeedback::TransformFeedback ( )
virtual globjects::TransformFeedback::~TransformFeedback ( )
protectedvirtual

Member Function Documentation

virtual void globjects::TransformFeedback::accept ( ObjectVisitor visitor)
overridevirtual

Implements globjects::Object.

void globjects::TransformFeedback::bind ( ) const
static void globjects::TransformFeedback::unbind ( )
static
void globjects::TransformFeedback::begin ( gl::GLenum  primitiveMode)
void globjects::TransformFeedback::pause ( )
void globjects::TransformFeedback::resume ( )
void globjects::TransformFeedback::end ( )
void globjects::TransformFeedback::draw ( gl::GLenum  primitiveMode) const
void globjects::TransformFeedback::setVaryings ( const Program program,
gl::GLsizei  count,
const char **  varyingNames,
gl::GLenum  bufferMode 
)
void globjects::TransformFeedback::setVaryings ( const Program program,
const std::vector< std::string > &  varyingNames,
gl::GLenum  bufferMode 
)
template<std::size_t Count>
void globjects::TransformFeedback::setVaryings ( const Program program,
const std::array< std::string, Count > &  varyingNames,
gl::GLenum  bufferMode 
)
static bool globjects::TransformFeedback::isTransformFeedback ( gl::GLuint  id)
static
virtual gl::GLenum globjects::TransformFeedback::objectType ( ) const
overridevirtual

Implements globjects::Object.

void globjects::TransformFeedback::bind ( gl::GLenum  target) const
protected
static void globjects::TransformFeedback::unbind ( gl::GLenum  target)
staticprotected

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