an array of vertex attribute properties
the shader currently used by this batcher
the default shader created by this batcher
primitive type to render (gl.POINTS, gl.LINE_STRIP, gl.LINE_LOOP, gl.LINES, gl.TRIANGLE_STRIP, gl.TRIANGLE_FAN, gl.TRIANGLES)
the name of the projection matrix uniform in the shader
the stride of a single vertex in bytes (will automatically be calculated as attributes definitions are added)
whether this batcher uses indexed drawing
the vertex data buffer used by this batcher
the size of a single vertex in floats (will automatically be calculated as attributes definitions are added)
add vertex attribute property definition to the batcher
name of the attribute in the vertex shader
number of components per vertex attribute. Must be 1, 2, 3, or 4.
data type of each component in the array
whether integer data values should be normalized into a certain range when being cast to a float
offset in bytes of the first component in the vertex attribute array
Add index values to the index buffer (only for indexed batchers). Indices are rebased relative to the current vertex count.
array of index values to add
Add a textured quad
Source texture atlas
Destination x-coordinate
Destination y-coordinate
Destination width
Destination height
Texture UV (u0) value.
Texture UV (v0) value.
Texture UV (u1) value.
Texture UV (v1) value.
tint color to be applied to the texture in UINT32 (argb) format
Optionalreupload: boolean = falseForce the texture to be reuploaded even if already bound
called by the WebGL renderer when a batcher becomes the current one
assign the given WebGL texture to the current batch
a WebGL texture
Texture unit to which the given texture is bound
Draw a screen-aligned quad with the given raw WebGL texture through the given shader. Binds the texture to unit 0, pushes 4 vertices (Y-flipped UVs), flushes, then unbinds the texture.
the raw GL texture to blit
destination x
destination y
destination width
destination height
the shader effect to apply
Create a WebGL texture from an image
Destination texture unit
Optionalpixels: Source image
gl.LINEAR or gl.NEAREST
Optionalrepeat: string = "no-repeat"Image repeat behavior
Optionalw: number = pixels.widthSource image width
Optionalh: number = pixels.heightSource image height
OptionalpremultipliedAlpha: boolean = trueMultiplies the alpha channel into the other color channels
Optionalmipmap: boolean = trueWhether mipmap levels should be generated
a WebGL texture
delete the given WebGL texture
a WebGL texture or TextureAtlas to delete
Flush batched texture data to the GPU using indexed drawing.
Optionalmode: number = ...the GL drawing mode
returns the WebGL texture associated to the given texture unit
Texture unit to which a texture is bound
texture a WebGL texture
set/change the current projection matrix
the new projection matrix
called by the WebGL renderer when this batcher is being replaced by another. Disables this batcher's vertex attribute locations so they don't leak across (otherwise stale stride/offset state can cause INVALID_OPERATION on the next draw).
unbind the given WebGL texture, forcing it to be reuploaded
Optionaltexture: WebGLTexturea WebGL texture
Optionalunit: numberTexture unit to unbind from
unit the unit number that was associated with the given texture
Deprecated
since 18.1.0
See
QuadBatcher