Solved Question about OGL Example
-
Hello,
i'm working on an OpenGL project and looked in the Qt Examples. I found this example code:
http://doc.qt.io/qt-5/qtopengl-cube-geometryengine-cpp.html
Can someone tell me, where the ogl shader is actually told that the indices are located in VBO 1 and the positions in VBO 0?? -
Hi,
Do you mean in the
drawCubeGeometry
method ? -
Yes, most of it I understand. But I don't know why ogl knows that the indices are in vbo 1 and not in 0 or 2.
-
That's done in
initCubeGeometry
-
ouch, i haven't seen the different. Thank you
arrayBuf.bind();
arrayBuf.allocate(vertices, 24 * sizeof(VertexData));indexBuf.bind();
indexBuf.allocate(indices, 34 * sizeof(GLushort));