Note that there are some explanatory texts on larger screens.

plurals
  1. POglVertexAttribPointer clarification
    primarykey
    data
    text
    <p>Just want to make sure I understand this correctly (I'd ask on SO Chat, but it's dead in there!):</p> <p>We've got a Vertex Array, which we make "current" by binding it<br> then we've got a Buffer, which we bind to a Target<br> then we fill that Target via <code>glBufferData</code> which essentially populates whatever was bound to that target, i.e. our Buffer<br> and then we call <code>glVertexAttribPointer</code> which describes how the data is laid out -- the data being whatever is bound to <code>GL_ARRAY_BUFFER</code> and this descriptor is saved to our original Vertex Array </p> <p>(1) Is my understanding correct?<br> The <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glVertexAttribPointer.xhtml" rel="noreferrer">documentation</a> is a little sparse about how everything correlates.</p> <p>(2) Is there some kind of default Vertex Array? Because I forgot/omitted <code>glGenVertexArrays</code> and <code>glBindVertexArray</code> and my program worked fine without it.</p> <hr> <p><strong>Edit:</strong> I missed a step... <code>glEnableVertexAttribArray</code>. </p> <p>(3) Is the Vertex Attrib tied to the Vertex Array at the time <code>glVertexAttribPointer</code> is called, and then we can enable/disable that attrib via <code>glEnableVertexAttribArray</code> at any time, regardless of which Vertex Array is currently bound?</p> <p>Or (3b) Is the Vertex Attrib tied to the Vertex Array at the time <code>glEnableVertexAttribArray</code> is called, and thus we can add the same Vertex Attrib to multiple Vertex Arrays by calling <code>glEnableVertexAttribArray</code> at different times, when different Vertex Arrays are bound?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload