Initializes a new WebGL dynamic buffer.
The active WebGL rendering context state.
Type of the underlying data elements to bind.
Determines the type of WebGLBuffer (defaults to gl.ARRAY_BUFFER).
Determines the data usage pattern (defaults to gl.DYNAMIC_DRAW).
The actual WebGLBuffer object maintained by this instance.
ReadonlybyteThe number of bytes per element based on the ArrayType.
ProtecteddirtySignifies whether the buffer has been updated and requires resyncing to the GPU.
Optionalfloat32Float32Array view of the underlying memory buffer.
The related WebGL rendering context.
ProtectedmaxThe maximum number of elements the buffer can currently hold without resizing.
ReadonlytypeThe WebGL buffer type, e.g., gl.ARRAY_BUFFER.
The main typed array view corresponding to the specified ArrayType.
Optionaluint16Uint16Array view of the underlying memory buffer.
Optionaluint32Uint32Array view of the underlying memory buffer.
ReadonlyusageUsage hint for WebGL, e.g., gl.DYNAMIC_DRAW.
The number of elements currently used in the buffer.
The number of elements currently stored in the buffer.
Binds this buffer object tracking it as the current bound buffer to the GPU.
Uploads the local buffer data to the GPU memory synchronously.
Clears CPU side data usage and marks buffer as synced to stop needless updates.
Gets the value of the element at the specified index.
The index of the element to retrieve.
The requested element.
Returns a constrained view of the primary typed array up to the specified range.
If end is omitted, returns the whole reallocated buffer slice.
The starting index (inclusive). Defaults to 0.
Optionalend: numberThe ending index (exclusive). Optional.
A subarray corresponding to the specified range.
Returns the typed array constructor for the corresponding ArrayType.
The type of the array.
The typed array constructor.
Flags the buffer as dirty, marking it for future data synchronization.
Removes and returns the last element in the buffer.
The removed element or undefined if the buffer is empty.
Appends an element to the buffer, using the primary typed array view.
The item to add.
Appends a new 32-bit floating point element to the buffer.
The item to add.
Appends a new 32-bit unsigned integer element to the buffer.
The item to add.
Resets the buffer's used element count, effectively emptying it.
Same behavior as clear.
Checks if the buffer has enough space for additional elements and resizes the buffer if necessary.
The number of new elements that need to be accommodated.
true if the buffer was resized, false otherwise.
ProtectedsetReallocates the underlying array buffer to a new size and copies existing data.
The new maximum number of elements.
Returns the last element pushed to the buffer without removing it.
The last element.
Updates the typed array views when the internal array buffer gets reallocated.
A specialized dynamic buffer intended for WebGL operations.