The renderer that owns this context.
Optionaloptions: DrawingContextOptionsThe options for this context.
Which renderbuffers in the framebuffer to clear when the DrawingContext comes into use. This is the mask of buffers to clear: gl.COLOR_BUFFER_BIT, gl.DEPTH_BUFFER_BIT, gl.STENCIL_BUFFER_BIT.
The blend mode to use when rendering. This is an index into the renderer's blendModes array. It is faster to check than the state object.
ReadonlycameraThe camera used by this context. Set this using setCamera to ensure
the view matrix is updated. Ensure that this is not null before
rendering.
The WebGLFramebufferWrapper which will hold the framebuffer output. This may contain the canvas.
The height of the framebuffer.
The last time the DrawingContext was used. This is used to determine whether the context is a candidate for reuse in a pool.
The pool to return to when this context is no longer needed. Used only for temporary contexts.
The renderer that owns this context.
Relevant WebGL state for the DrawingContext. Contains the framebuffer, scissor box, and viewport.
The WebGLTextureWrapper which will hold the framebuffer output.
This is only used if useCanvas is false.
Whether to use the canvas as the framebuffer.
The width of the framebuffer.
Begin drawing with the DrawingContext.
This should be called before rendering to set up the framebuffer and other WebGL state.
Clear the framebuffer. This will bind the framebuffer.
Copy the state of another DrawingContext.
The DrawingContext to copy from.
Destroys the DrawingContext and its resources.
Create a clone of the DrawingContext. This is intended to be mutated for temporary use, and then thrown away.
The autoClear setting is set to false unless specified. This is because most clones reference an existing framebuffer, which is intended to accumulate drawing operations.
OptionalpreserveAutoClear: booleanWhether to preserve the autoClear setting. Default false.
Check whether the DrawingContext is locked.
Lock the DrawingContext to be in use.
This prevents release from returning it to its pool
until unlock is called with the appropriate key.
This is used for temporary DrawingContexts,
which may be returned to a pool.
The key to lock the DrawingContext with.
End using the DrawingContext. This marks the context as not in use, so its framebuffer and texture are not needed any more and may be cleared at any time. This will finish any outstanding batches.
If there are no locks on the DrawingContext, and it comes from a pool, it will be returned to its pool.
Resize the DrawingContext.
Delete the framebuffer and texture, and create new ones with the new size. The scissor box and viewport are reset to match the new size.
The new width of the framebuffer.
The new height of the framebuffer.
Set the buffers to clear when the DrawingContext comes into use.
Whether to clear the color buffer.
Whether to clear the depth buffer.
Whether to clear the stencil buffer.
Set the blend mode for the DrawingContext.
The blend mode to set.
OptionalblendColor: number[]The blend color to set. This is an array of 4 values: red, green, blue, alpha.
Set the clear color for the DrawingContext. No changes will be made if the color is the same as the current clear color.
The red component of the color to clear with.
The green component of the color to clear with.
The blue component of the color to clear with.
The alpha component of the color to clear with.
Set the scissor box for the DrawingContext.
The x coordinate of the scissor box.
The y coordinate of the scissor box.
The width of the scissor box.
The height of the scissor box.
Enable or disable the scissor box for the DrawingContext.
Whether to enable the scissor box.
Unlock the DrawingContext.
This allows release to return it to its pool.
The key to unlock the DrawingContext with. This must be the same key used to lock it.
Optionalrelease: booleanWhether to release the DrawingContext immediately. This will only happen if there are no other locks on it.
Begin using the DrawingContext. This will finish any outstanding batches and run any autoClear.
DrawingContext