更改顶点数组对象

时间:2015-10-09 15:13:35

标签: opengl

让我们看看这段代码:

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);

? 我可以这样改变顶点声明布局吗?有办法做到吗?

0 个答案:

没有答案