regl is designed in such a way that you should never have to directly access the underlying
WebGL context. However, if you really absolutely need to do this for some reason (for example
to interface with an external library), you can still get a reference to the WebGL context
via the property _gl.
The context creation attributes passed to the WebGL context constructor.
regl exposes info about the WebGL context limits and capabilities via the limits object.
regl tracks several metrics for performance monitoring. These can be read using the stats object.
regl is designed in such a way that you should never have to directly access the underlying
WebGL context. However, if you really absolutely need to do this for some reason (for example
to interface with an external library), you can still get a reference to the WebGL context
via the property REGL._gl. Note, though, that if you have changed the WebGL state, you must
call _refresh to restore the regl state in order to prevent rendering errors.
Creates an empty buffer of length length.
Creates a buffer with the provided data.
Creates a buffer using creation options.
Clears selected buffers to specified values.
If an option is not present, then the corresponding buffer is not cleared.
Relevant WebGL API: gl.clear
Destroys the gl context and releases all associated resources.
Executes an empty draw command.
Registers a callback to be called on each animation frame.
This method integrates with requestAnimationFrame and context loss
events. It also calls gl.flush and drains several internal buffers,
so you should try to do all your rendering to the drawing buffer within
the frame callback.
Test if an extension is present. Argument is case insensitive.
For more information on WebGL extensions, see the WebGL extension registry.
Relevant WebGL APIs
case-insensitive name of WebGL extension
Returns Total time elapsed since regl was initialized in seconds.
Registers a handler function to be called when the associated regl event is fired.
Updates the values of internal times and recalculates the size of viewports.
Dynamic variable binding
prop, context, and this generate DynamicVariables, which can be used as values in a
REGL.DrawConfig object. A DynamicVariable is an abstraction that will render a value only
when the DrawCommand with which it's associated is invoked.
Read entire screen. NB: Reading into a Float32Array requires OES_texture_float.
Read entire screen into an existing TypedArray. NB: Reading into a Float32Array requires OES_texture_float.
Read a selected region of screen or framebuffer. NB: Reading into a Float32Array requires OES_texture_float.
Generated using TypeDoc
Creates a new REGL command. The resulting command, when executed, will set a WebGL state machine to a specified
state.