Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ExtensionsHash

Hierarchy

  • ExtensionsHash

Index

Properties

Static Protected BASE64_ALPHABET

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

Static Protected EXTENSIONS_BY_VERSION

EXTENSIONS_BY_VERSION: Map<number, string[]> = new Map<number, Array<string>>([[0b000, ['ANGLE_instanced_arrays','EXT_blend_minmax','EXT_color_buffer_float','EXT_color_buffer_half_float','EXT_disjoint_timer_query','EXT_disjoint_timer_query_webgl2','EXT_frag_depth','EXT_shader_texture_lod','EXT_sRGB','EXT_texture_filter_anisotropic','OES_element_index_uint','OES_standard_derivatives','OES_texture_float','OES_texture_float_linear','OES_texture_half_float','OES_texture_half_float_linear','OES_vertex_array_object','WEBGL_color_buffer_float','WEBGL_compressed_texture_astc','WEBGL_compressed_texture_atc','WEBGL_compressed_texture_etc','WEBGL_compressed_texture_etc1','WEBGL_compressed_texture_pvrtc','WEBGL_compressed_texture_s3tc','WEBGL_compressed_texture_s3tc_srgb','WEBGL_debug_renderer_info','WEBGL_debug_shaders','WEBGL_depth_texture','WEBGL_draw_buffers','WEBGL_lose_context',]],])

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 LATEST_VERSION

LATEST_VERSION: 0 = 0

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

Static Protected WEBGL_BACKENDS

WEBGL_BACKENDS: Array<string> = ['webgl1', 'webgl2']

Static Protected WEBGL_EXTENSIONS_BY_BACKEND

WEBGL_EXTENSIONS_BY_BACKEND: Map<number, string[]> = new Map<number, Array<string>>([[0, WEBGL1_EXTENSIONS],[1, WEBGL2_EXTENSIONS],])

Methods

Static complement

  • complement(backend: string, extensions: Array<string>): Array<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: Array<string>

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

    Returns Array<string>

Static decode

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

    Parameters

    • hash: string

      Versioned extension hash.

    Returns [string, Array<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: Array<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: Array<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