glVertexAttribPointer应该调用何时从文档中看不出来.看起来它是VBO初始化的一部分,但我注意到在渲染过程中调用它的示例代码.
glVertexAttribPointer(vertexAttributeId, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex2D), reinterpret_cast<const GLvoid*>(offsetof(Vertex2D, m_x)));
应该glVertexAttribPointer在初始化期间调用,GL_ARRAY_BUFFER还是应该在渲染期间调用(调用之后glBindBuffer)?
opengl ×1