SenOGL  0.2
Library aiming to ease the use of OpenGL
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
TransformFeedback Class Reference

OpenGL TransformFeedback Object. More...

#include <TransformFeedback.hpp>

Inheritance diagram for TransformFeedback:
OpenGLObject

Public Member Functions

 TransformFeedback ()=default
 
 ~TransformFeedback ()
 
virtual void init () override
 Generates a new TransformFeedback name to manage. More...
 
virtual void cleanup () override
 Destroy managed TransformFeedback object. More...
 
void bind () const
 Binds the TransformFeedback object. More...
 
void bindBuffer (GLuint index, const Buffer &buffer, GLintptr offset=0, GLsizeiptr size=0)
 Binds the specified buffer to index for this TransformFeedback Object. More...
 
void draw (Primitive primitiveType) const
 Draw using this transform feedback. More...
 
void drawInstanced (Primitive primitiveType, GLuint instanceCount) const
 Draw using this transform feedback. More...
 
void drawStream (Primitive primitiveType, GLuint stream) const
 Draw using this transform feedback. More...
 
void drawStreamInstanced (Primitive primitiveType, GLuint stream, GLuint instanceCount) const
 Draw using this transform feedback. More...
 
- Public Member Functions inherited from OpenGLObject
 OpenGLObject ()
 
 OpenGLObject (GLuint handle)
 Constructs a instance managing an existing OpenGL Object. More...
 
 OpenGLObject (const OpenGLObject &)=default
 
 OpenGLObject (OpenGLObject &&)=default
 
OpenGLObjectoperator= (const OpenGLObject &)=default
 
OpenGLObjectoperator= (OpenGLObject &&)=default
 
virtual ~OpenGLObject ()
 
GLuint getName () const
 Returns OpenGL name of the object. More...
 
void setName (GLuint n)
 Sets the OpenGL name of the object managed by this instance /!\ Use with caution ! (assignment operator is probably what you're looking for) More...
 
virtual bool isValid () const
 Returns true if the object seems valid. More...
 
 operator bool () const
 Syntactic sugar for isValid(). More...
 

Static Public Member Functions

static void unbind ()
 Unbinds any currently bound TransformFeedback object (back to the default one (0)). More...
 
static void begin (Primitive primitiveType=Primitive::Triangles)
 Begins a transform feedback operation, using the currently bound container object (TFO, default (0) is a valid option). More...
 
static void end ()
 Ends a transform feedback operation. More...
 
static void pause ()
 Pauses a transform feedback operation. More...
 
static void resume ()
 Resumes a transform feedback operation. More...
 
static void draw (Primitive primitiveType, GLuint transformFeedbackObject)
 Wrapper arround glDrawTransformFeedback. More...
 
static void drawInstanced (Primitive primitiveType, GLuint transformFeedbackObject, GLuint instanceCount)
 Wrapper arround glDrawTransformFeedbackInstanced. More...
 
static void drawStream (Primitive primitiveType, GLuint transformFeedbackObject, GLuint stream)
 Wrapper arround glDrawTransformFeedbackStream. More...
 
static void drawStreamInstanced (Primitive primitiveType, GLuint transformFeedbackObject, GLuint stream, GLuint instanceCount)
 Wrapper arround glDrawTransformFeedbackStreamInstanced. More...
 
static void enableRasterization ()
 Enable rasterization (default behavior). More...
 
static void disableRasterization ()
 Disable rasterization (useful for TransformFeedback). More...
 

Additional Inherited Members

- Protected Attributes inherited from OpenGLObject
GLuint _handle
 OpenGL name of the managed object. More...
 

Detailed Description

OpenGL TransformFeedback Object.

Constructor & Destructor Documentation

TransformFeedback::TransformFeedback ( )
default
TransformFeedback::~TransformFeedback ( )

Member Function Documentation

void TransformFeedback::begin ( Primitive  primitiveType = Primitive::Triangles)
inlinestatic

Begins a transform feedback operation, using the currently bound container object (TFO, default (0) is a valid option).

Parameters
primitiveTypeType of primitives captured by the transform feedback. Must be Points, Lines or Triangles (default).
See also
end
void TransformFeedback::bind ( ) const
inline

Binds the TransformFeedback object.

See also
unbind()
void TransformFeedback::bindBuffer ( GLuint  index,
const Buffer buffer,
GLintptr  offset = 0,
GLsizeiptr  size = 0 
)

Binds the specified buffer to index for this TransformFeedback Object.

Note: This effectively binds the TransformFeedback Object (calls bind()).

Parameters
indexBinding Point
bufferBuffer to bind
offsetStarting offset in basic machine unit (optional, default: 0)
sizeAmount of data in machine unit to bind (optional, default: 0, means the entire buffer)
See also
bind()
void TransformFeedback::cleanup ( )
overridevirtual

Destroy managed TransformFeedback object.

Implements OpenGLObject.

void TransformFeedback::disableRasterization ( )
inlinestatic

Disable rasterization (useful for TransformFeedback).

Todo:
Move this elsewhere ? (If we have a context class one day...)
See also
GL_RASTERIZER_DISCARD
void TransformFeedback::draw ( Primitive  primitiveType) const
inline

Draw using this transform feedback.

Parameters
primitiveTypeType of primitives to draw.
void TransformFeedback::draw ( Primitive  primitiveType,
GLuint  transformFeedbackObject 
)
inlinestatic

Wrapper arround glDrawTransformFeedback.

Parameters
primitiveTypeType of primitives to draw.
transformFeedbackObjectName of a TransformFeedback Object from which to retrieve a primitive count (0 for the default one is a valid value).
void TransformFeedback::drawInstanced ( Primitive  primitiveType,
GLuint  instanceCount 
) const
inline

Draw using this transform feedback.

Parameters
primitiveTypeType of primitives to draw.
instanceCountNumber of instances to draw.
void TransformFeedback::drawInstanced ( Primitive  primitiveType,
GLuint  transformFeedbackObject,
GLuint  instanceCount 
)
inlinestatic

Wrapper arround glDrawTransformFeedbackInstanced.

Parameters
primitiveTypeType of primitives to draw.
transformFeedbackObjectName of a TransformFeedback Object from which to retrieve a primitive count (0 for the default one is a valid value).
instanceCountNumber of instances to draw.
void TransformFeedback::drawStream ( Primitive  primitiveType,
GLuint  stream 
) const
inline

Draw using this transform feedback.

Parameters
primitiveTypeType of primitives to draw.
streamStream transform buffer from which to retrieve a primitive count.
void TransformFeedback::drawStream ( Primitive  primitiveType,
GLuint  transformFeedbackObject,
GLuint  stream 
)
inlinestatic

Wrapper arround glDrawTransformFeedbackStream.

Parameters
primitiveTypeType of primitives to draw.
transformFeedbackObjectName of a TransformFeedback Object from which to retrieve a primitive count (0 for the default one is a valid value).
streamStream transform buffer from which to retrieve a primitive count.
Todo:
add overload for Buffer (instead of raw stream).
void TransformFeedback::drawStreamInstanced ( Primitive  primitiveType,
GLuint  stream,
GLuint  instanceCount 
) const
inline

Draw using this transform feedback.

Parameters
primitiveTypeType of primitives to draw.
streamStream transform buffer from which to retrieve a primitive count.
instanceCountNumber of instances to draw.
void TransformFeedback::drawStreamInstanced ( Primitive  primitiveType,
GLuint  transformFeedbackObject,
GLuint  stream,
GLuint  instanceCount 
)
inlinestatic

Wrapper arround glDrawTransformFeedbackStreamInstanced.

Parameters
primitiveTypeType of primitives to draw.
transformFeedbackObjectName of a TransformFeedback Object from which to retrieve a primitive count (0 for the default one is a valid value).
streamStream transform buffer from which to retrieve a primitive count.
instanceCountNumber of instances to draw.
Todo:
add overload for Buffer (instead of raw stream).
void TransformFeedback::enableRasterization ( )
inlinestatic

Enable rasterization (default behavior).

Todo:
Move this elsewhere ? (If we have a context class one day...)
See also
GL_RASTERIZER_DISCARD
void TransformFeedback::end ( )
inlinestatic

Ends a transform feedback operation.

See also
begin
void TransformFeedback::init ( )
overridevirtual

Generates a new TransformFeedback name to manage.

Implements OpenGLObject.

void TransformFeedback::pause ( )
inlinestatic

Pauses a transform feedback operation.

void TransformFeedback::resume ( )
inlinestatic

Resumes a transform feedback operation.

void TransformFeedback::unbind ( )
inlinestatic

Unbinds any currently bound TransformFeedback object (back to the default one (0)).


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