title: Usage of QOpenGLVertexArrayObject
body: <p>i have a question concering VAO in QT. As supposed <a href="http://qt-project.org/doc/qt-5.1/qtgui/qopenglvertexarrayobject.html" rel="noreferrer">here</a>, i wrote the following piece of code for initialization:
  </p>
  
  <pre><code>void GLWidget::initializeGL() {
      vao.create();
      vao.bind();
      // setting up buffers
      buffer.create();
      buffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
      buffer.bind();
      buffer.allocate(vertices.data(), 3 * vertices.size() * sizeof(float));
      vao.release();
  
  }
  </code></pre>
  
  <p>In the painting stage, i simply do the following:</p>
  
  <pre><code>void GLWidget::paintGL() {
    // some other code
    vao.bind();
    if(shader_program-&gt;isLinked()) {
      shader_program-&gt;setUniformValue("mvpMatrix", p_matrix * v_matrix * m_matrix);
      // the interesting part about the buffer:
      shader_program-&gt;setAttributeBuffer("vertex", GL_FLOAT, 0, 3);
      shader_program-&gt;enableAttributeArray("vertex");
      // the drawing
      glDrawArrays(GL_TRIANGLES, 0, vertices.size());
      shader_program-&gt;disableAttributeArray("vertex");
    } 
    vao.release();
  } 
  </code></pre>
  
  <p>This works as far as i am dealing with only one VAO. But while using multiple VAO's, nothing or only one 'object' (buffer) is drawn. The code is exactly the same for each object, so the drawing is always </p>
  
  <ol>
  <li>Bind VAO</li>
  <li>Assign variables to the shader program</li>
  <li>Draw Triangles</li>
  <li>Release VAO</li>
  </ol>
  
  <p>So the question is how to use multiple vao's including different buffers.</p>