Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ExtensionsHash

Hierarchy

  • ExtensionsHash

Index

Constructors

constructor

Properties

Static Protected Readonly BASE64_ALPHABET

BASE64_ALPHABET: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-+" = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-+'

Static Protected Readonly EXTENSIONS_BY_VERSION

EXTENSIONS_BY_VERSION: Map<number, string[]> = ...

All known WebGL extensions (regardless of WebGL version). When new extensions become known, a new internal version has to be created, comprising all extensions again (some removed, some added w.r.t. previous versions).

Static Protected Readonly LATEST_VERSION

LATEST_VERSION: 0 = 0b000

Hash versioning is used to account for future, yet unknown/unpublished extensions while maintaining support for existing hashes.

Static Protected Readonly WEBGL_BACKENDS

WEBGL_BACKENDS: string[] = ...

Static Protected Readonly WEBGL_EXTENSIONS_BY_BACKEND

WEBGL_EXTENSIONS_BY_BACKEND: Map<number, string[]> = ...

Methods

Static complement

  • complement(backend: string, extensions: string[]): string[]
  • For a given set of extensions, this generates the complementary set of extensions for a given backend.

    Parameters

    • backend: string

      WebGL backend: 'webgl1' or 'webgl2'.

    • extensions: string[]

      Array of extensions to be complemented to all extensions available to the backend.

    Returns string[]

Static decode

  • decode(hash: string): [string, string[]]
  • Decodes a hash into a WebGL backend and supported extensions.

    Parameters

    • hash: string

      Versioned extension hash.

    Returns [string, string[]]

    • Tuple of webgl backend and an array of extensions.

Static Protected decode64

  • decode64(base64: string): number
  • Decodes a single base64 encoded character to a number of bitfield semantics.

    Parameters

    • base64: string

      Single base64 encoded character (string).

    Returns number

Static encode

  • encode(backend: BackendType, supported: string[]): string
  • Generates a hash that encodes the contexts webgl backend and extension support. This is intended to be queried whenever support for a given context on a foreign client is due. The hash can be used as masquerade input.

    Parameters

    • backend: BackendType

      WebGL backend: 'webgl1' or 'webgl2'.

    • supported: string[]

      Array of supported extensions to be encoded.

    Returns string

Static Protected encode64

  • encode64(bitfield: number): string
  • Encodes a number of bitfield semantics (of 6 bits) into a base64 character.

    Parameters

    • bitfield: number

    Returns string