When should glVertexAttribPointer be called?

后端 未结 4 1034
萌比男神i
萌比男神i 2020-12-07 11:33

It\'s not obvious from the documentation when glVertexAttribPointer should be called. It looks like it\'s part of VBO initialisation, but I notice example code

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-07 11:55

    The association of buffer, generic vertex attribute and shader attribute variable are quite subtle. glVertexAttribPointer establishes this association. See OpenGL-Terminology for a detailed explanation.

    Also, the link OpenGL-VBO,shader,VAO shows a working example with the necessary sequence of API calls.

提交回复
热议问题