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 VBOELEMENT_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 VBOELEMENT_ARRAY_BUFFER
: To refer to the currently bound IBO
And parameter
can be:
BUFFER_SIZE
: Returns the size of the requested bufferBUFFER_USAGE
: Returns the usage of the requested buffer
Note
Your VBO and/or IBO needs to be bound when you enquire about the state of...