The WebGLRenderer instance that owns this wrapper.
An ArrayBuffer of data to store. The buffer will be permanently associated with this data.
The type of the buffer being created.
The usage of the buffer being created. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW.
The type of the buffer.
The usage of the buffer. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW.
The data associated with the buffer.
Note that this will be used to recreate the buffer if the WebGL context is lost.
The WebGLRenderer instance that owns this wrapper.
A Float32Array view of the dataBuffer.
This will be null if the byte length of the dataBuffer
is not divisible by Float32Array.BYTES_PER_ELEMENT (4).
Such a buffer is only suited for use with 16-bit indices.
A Uint16Array view of the dataBuffer.
This will be null if the byte length of the dataBuffer
is not divisible by Uint16Array.BYTES_PER_ELEMENT (2).
Such a buffer is only suited for use with byte data.
A Uint32Array view of the dataBuffer.
This will be null if the byte length of the dataBuffer
is not divisible by Uint32Array.BYTES_PER_ELEMENT (4).
Such a buffer is only suited for use with 16-bit indices.
A Uint8Array view of the dataBuffer.
The WebGLBuffer being wrapped by this class.
This property could change at any time. Therefore, you should never store a reference to this value. It should only be passed directly to the WebGL API for drawing.
Binds this WebGLBufferWrapper to the current WebGLRenderingContext. It uses the bufferType of this wrapper to determine which binding point to use.
Optionalunbind: booleanWhether to unbind the buffer instead. Default false.
Creates a WebGLBuffer for this WebGLBufferWrapper.
This is called automatically by the constructor. It may also be called again if the WebGLBuffer needs re-creating.
Remove this WebGLBufferWrapper from the GL context.
Resizes the dataBuffer of this WebGLBufferWrapper.
This will recreate dataBuffer and the views into it.
All data will be lost.
All views into dataBuffer will be destroyed and recreated.
The new size of the buffer in bytes.
Updates the data in this WebGLBufferWrapper. The dataBuffer must contain the new data to be uploaded to the GPU. Data will preserve its range from dataBuffer to the WebGLBuffer.
Optionalbytes: numberThe number of bytes to update in the buffer. If not specified, the entire buffer will be updated.
Optionaloffset: numberThe offset into the buffer to start updating data at. Default 0.
Wrapper for a WebGL buffer, containing all the information that was used to create it. This can be a VertexBuffer or IndexBuffer.
A WebGLBuffer should never be exposed outside the WebGLRenderer, so the WebGLRenderer can handle context loss and other events without other systems having to be aware of it. Always use WebGLBufferWrapper instead.