如何将两个顶点缓冲区绑定到不同的插槽(slot0 和 slot1),
我想要在 OpenGL(QT) 中这样的东西:
QGLBuffer VB0, VB1;
VB0.bind(0);
VB1.bind(1);
到目前为止我有这个:
verticesBuffer = new QGLBuffer(QGLBuffer::VertexBuffer);
verticesBuffer->create();
verticesBuffer->bind();
verticesBuffer->setUsagePattern(QGLBuffer::DynamicDraw);
verticesBuffer->allocate(vertices.constData(), _ANGLE_CNT * _RANGE_CNT * 6 * sizeof(QVector3D));
verticesBuffer->release();
colorsBuffer = new QGLBuffer(QGLBuffer::VertexBuffer);
colorsBuffer->create();
colorsBuffer->bind();
colorsBuffer->setUsagePattern(QGLBuffer::DynamicDraw);
colorsBuffer->allocate(_ANGLE_CNT * _RANGE_CNT * 6 * sizeof(float));
colorsBuffer->release();
您能否编写一个示例来解释我应该如何将这两个缓冲区绑定到插槽?