I’ve got some ofBufferObjects that I’ve filled with a vector of
glm::vec3s. At intervals, I want to upload new data into each. Sometimes there will be more data, sometimes there will be less data, but it’ll be a different amount each time I upload.
Right now I’m doing
buffer.allocate(dataVector, GL_STATIC_DRAW); buffer.setData(dataVector, GL_STATIC_DRAW);
each time I want to refresh with new data, but it doesn’t seem to be refreshing with the new values. There’s also
ofBufferObject::updateData, but that doesn’t seem to increase the size of the buffer if there was fewer items to start with.
Intuitively, what I would like to do is
- clear the buffer
- set the size of the buffer
- upload the data into the buffer
What’s the correct way to approach this?