globjects  2.0.0.690708773bba
Strict OpenGL objects wrapper.

Interface to use transform feedback. More...

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

Inheritance diagram for globjects::TransformFeedback:
globjects::Object globjects::Instantiator< TransformFeedback >

Public Member Functions

 TransformFeedback ()
 
virtual ~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 ()
 

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)
 
- Static Public Member Functions inherited from globjects::Instantiator< TransformFeedback >
static std::unique_ptr< TransformFeedbackcreate (Args &&...args)
 
static std::unique_ptr< TransformFeedbackfromId (gl::GLuint id, Args &&...args)
 

Protected Member Functions

void bind (gl::GLenum target) const
 
- Protected Member Functions inherited from globjects::Object
 Object (std::unique_ptr< IDResource > &&resource)
 
virtual ~Object ()
 

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
std::unique_ptr< IDResourcem_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:

std::unique_ptr<Program> program = createProgramIncludingShaders();
std::unique_ptr<TransformFeedback> transformFeedback = TransformFeedback::create();
std::unique_ptr<Buffer> buffer = Buffer::create(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 ( )
virtual

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: