can you someone recommend any literature on attributes and how to update them in realtime?
I am new to C++ and Cinder and I have been playing with the ParticlesSphereGPU example a lot.
It seems that the data structures are bound and allocated once and I can’t update those values from the CPU, right?
Can anyone point me to any documentation about these specific lines:
gl::ScopedVao source(data);
gl::ScopedVao vao(data);
You definitely can update them from the CPU by mapping the buffers (i.e. memory on the GPU) that hold your vertex attributes. Check out gl::Vbo’s member functions like mapReplace, mapBufferRange, etc.
To learn about VAOs, VBOs, and vertex attributes, I’d start with this tutorial
Scoped variables are one of Cinder’s ways of managing OpenGL state, providing a pretty elegant way to bind and (subsequently) unbind an OpenGL object. When the gl::Scoped* variable is created on the stack, it will bind the corresponding OpenGL object to the context, and when that variable is destroyed, it will automatically unbind the managed object. This follows a C++ paradigm called RAII (Resource Acquisition Is Initialization).