title: VAO and GL_ELEMENT_ARRAY_BUFFER association
body: <p>I have a problem understanding association between VAO and buffer bound to <code>GL_ELEMENT_ARRAY_BUFFER</code> (let's call it EBO). I got to know that it is part of VAO state, but differ from buffers used along with <code>glVertexAttribPointer</code> calls (those buffers are simply remembered by VAO as attributes storage omitting need to bind them - if I understood correctly).<br>
  In <a href="https://www.opengl.org/discussion_boards/showthread.php/191167-Confirmation-that-I-actually-understand-VAOs-VBOs-and-EBOs?p=1272385&amp;viewfull=1#post1272385" rel="nofollow noreferrer">this</a> discussion it is claimed:  </p>
  
  <blockquote>
    <p>Unlike GL_ARRAY_BUFFER, a VAO store the current binding for GL_ELEMENT_ARRAY_BUFFER. Calling glBindBuffer(GL_ELEMENT_ARRAY_BUFFER) stores a reference to the specified buffer in the currently-bound VAO. glDrawElements() etc take the vertex indices from the buffer stored in the currently-bound VAO. So switching between VAOs switches between element arrays.  </p>
  </blockquote>
  
  <p>But do I need to call <code>glBindBuffer(GL_ELEMENT_ARRAY_BUFFER)</code> between bind and unbind of VAO to make sure it will 'save' it in its state or VAO will just take currently bound EBO when VAO gets created?<br>
  Also the answer quoted above isn't clear to me whether VAO just 'knows' (as attribute storage buffers) which buffer indices (<code>glDrawElements</code>) have to be taken from or does VAO binds proper EBO when VAO gets bound?  </p>
  
  <p><strong>edit:</strong> First of my questions has been answered <a href="https://stackoverflow.com/questions/33863426/vaos-and-element-buffer-objects">here</a>, however I believe the second one was answered by @Rabbid76.</p>