Is it possible to add vbos to vbos after their creation? For example (pseudo-code):
glGenVertexArrays(1, &_vao);
glBindVertexArray(_vao);
// do init stuff
glBindVertexArray(0);
// Much much later in a galaxy far away
glBindVertexArray(_vao);
glGenBuffers(1, &_instance_vbo);
glBindBuffer(GL_ARRAY_BUFFER, _instance_vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(blee), blee, GL_STATIC_DRAW);
glEnableVertexAttribArray(_vpos_att);
glVertexAttribPointer(_vpos_att, 3, GL_FLOAT, GL_FALSE, 0, (void*)0);
// Draw
So far it hasn't really worked. Looking at the bound vbos to my vao (using GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
) shows no buffers bound. Though that may be another problem altogether.