Create a new IndexBuffer instance.
The graphics device used to manage this index buffer.
The type of each index to be stored in the index buffer. Can be:
The number of indices to be stored in the index buffer.
Optional
usage: number = BUFFER_STATICThe usage type of the vertex buffer. Can be:
Defaults to BUFFER_STATIC.
Optional
initialData: ArrayBufferInitial data. If left unspecified, the index buffer will be initialized to zeros.
Optional
options: { storage?: boolean }Object for passing optional arguments.
Optional
storage?: booleanDefines if the index buffer can be used as a storage buffer by a compute shader. Defaults to false. Only supported on WebGPU.
Frees resources associated with this index buffer.
Returns the data format of the specified index buffer.
The data format of the specified index buffer. Can be:
Returns the number of indices stored in the specified index buffer.
The number of indices stored in the specified index buffer.
Gives access to the block of memory that stores the buffer's indices.
A contiguous block of memory where index data can be written to.
Signals that the block of memory returned by a call to the lock function is ready to be given to the graphics hardware. Only unlocked index buffers can be set on the currently active device.
An index buffer stores index values into a VertexBuffer. Indexed graphical primitives can normally utilize less memory that unindexed primitives (if vertices are shared).
Typically, index buffers are set on Mesh objects.