matus-chochlik / oglplus

OGLplus is a collection of open-source, cross-platform libraries which implement an object-oriented facade over the OpenGL® (version 3 and higher) and also OpenAL® (version 1.1) and EGL (version 1.4) C-language APIs. It provides wrappers which automate resource and object management and make the use of these libraries in C++ safer and more convenient.
http://oglplus.org/
Boost Software License 1.0
491 stars 72 forks source link

TransformFeedback::Activator #82

Closed karldd closed 9 years ago

karldd commented 9 years ago

I've noted in the documentation that an Activator "is a more robust and preferred mode of transform feedback activation and deactivation". Can you elaborate on that and the differences with DefaultTransformFeedback::Begin(); DefaultTransformFeedback::End();?

Specifically, I'm trying to support OpenGL 3.2 and when using the following line from the examples:

TransformFeedback::Activator xfb_act(TransformFeedbackPrimitiveType::Points);

I get:

Use of undeclared identifier 'TransformFeedback'
No member named 'Activator' in 'oglplus::tag::TransformFeedback'

Thanks!

matus-chochlik commented 9 years ago

Hi,

The Activator uses the RAII idiom so it calls glBeginTFb/glEndTFb automatically in constructor/destructor.

But in order to use the TransformFeedback class you need either (GL 4.0 or GL_ARB_transform_feedback2). Otherwise only the default transform feedback is available, which does not support named object binding, etc. In such case you need to use the DefaultTransformFeedback class:

DefaultTransformFeedback::Activator xfb_act(...);

HTH

Matus

karldd commented 9 years ago

Thanks!