WebGL as a state machine: buffer manipulation

There is some information about the state of the rendering pipeline that we can retrieve when we are dealing with buffers with the functions: getParameter, getBufferParameter, and isBuffer.

Just like we did in the previous chapter, we will use getParameter(parameter) where parameter can have the following values:

  • ARRAY_BUFFER_BINDING: It retrieves a reference to the currently-bound VBO
  • ELEMENT_ARRAY_BUFFER_BINDING: It retrieves a reference to the currently-bound IBO

Also, we can enquire about the size and the usage of the currently-bound VBO and IBO using getBufferParameter(type, parameter) where type can have the following values:

  • ARRAY_BUFFER: To refer to the currently bound VBO
  • ELEMENT_ARRAY_BUFFER ...

Get WebGL Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.