Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Regl

Documentation for interface Regl.

Hierarchy

  • Regl

Callable

  • Creates a new REGL command. The resulting command, when executed, will set a WebGL state machine to a specified state.

    Parameters

    Returns Command

Index

Properties

_gl

_gl: WebGLRenderingContext

attributes

attributes: WebGLContextAttributes

contextLost

contextLost: boolean

limits

limits: Limits

stats

stats: Stats

Methods

_refresh

  • _refresh(): void

buffer

clear

context

cube

destroy

  • destroy(): void
  • Destroys the gl context and releases all associated resources.

    Returns void

draw

  • draw(): void
  • Executes an empty draw command

    Returns void

elements

frame

  • frame(callback: function): Cancel
  • 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.

    Parameters

    • callback: function
        • (): void
        • Returns void

    Returns Cancel

framebuffer

framebufferCube

hasExtension

  • hasExtension(name: string): boolean
  • Test if an extension is present. Argument is case insensitive.

    For more information on WebGL extensions, see the WebGL extension registry.

    Relevant WebGL APIs

    Parameters

    • name: string

      case-insensitive name of WebGL extension

    Returns boolean

now

  • now(): number
  • Returns Total time elapsed since regl was initialized in seconds.

    Returns number

on

  • on(type: "frame", handler: function): Cancel
  • on(type: "lost", handler: function): Cancel
  • on(type: "restore", handler: function): Cancel
  • on(type: "destroy", handler: function): Cancel
  • Parameters

    • type: "frame"
    • handler: function
        • (): void
        • Returns void

    Returns Cancel

  • Parameters

    • type: "lost"
    • handler: function
        • (): void
        • Returns void

    Returns Cancel

  • Parameters

    • type: "restore"
    • handler: function
        • (): void
        • Returns void

    Returns Cancel

  • Parameters

    • type: "destroy"
    • handler: function
        • (): void
        • Returns void

    Returns Cancel

poll

  • poll(): void
  • Updates the values of internal times and recalculates the size of viewports.

    Returns void

prop

read

  • read(): Uint8Array | Float32Array
  • read<T>(data: T): T
  • read<T>(options: ReadOptions<T>): T
  • Read entire screen.

    Returns Uint8Array | Float32Array

  • Read entire screen into an existing ArrayBufferView.

    Type parameters

    • T: Uint8Array | Float32Array

    Parameters

    • data: T

    Returns T

  • Read a selected region of screen or framebuffer.

    Type parameters

    • T: Uint8Array | Float32Array

    Parameters

    Returns T

renderbuffer

texture

this

Generated using TypeDoc