让我们看看这段代码:
glGenVertexArrays(1, &name);
glBindVertexArray(name);
glBindBuffer(GL_ARRAY_BUFFER, someBuffer1);
glVertexAttribPointer(...);
(...)
glBindBuffer(GL_ARRAY_BUFFER, someBuffer2);
glVertexAttribPointer(...);
(...)
glBindVertexArray(0);
如果我决定做这样的事情,会发生什么:
glBindVertexArray(name);
glBindBuffer(GL_ARRAY_BUFFER, someBuffer3);
glVertexAttribPointer(...);
(...)
glBindBuffer(GL_ARRAY_BUFFER, someBuffer4);
glVertexAttribPointer(...);
(...)
glBindVertexArray(0);
? 我可以这样改变顶点声明布局吗?有办法做到吗?