Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "utils"

Index

Variables

Let glslangModule

glslangModule: any = null

Let uid

uid: number = 0

Functions

Clamp

  • Clamp(value: number, min: number, max: number): number
  • Clamps a value between the provided min and max range

    Parameters

    • value: number

      The value to clamp

    • min: number

      The minimum range

    • max: number

      The maximum range

    Returns number

CompileGLSL

  • CompileGLSL(glsl: string, type: string): Uint32Array
  • Compiles the provided GLSL code into SPIR-V

    Parameters

    • glsl: string

      The GLSL string to compile

    • type: string

      The shader type of the provided GLSL code

    Returns Uint32Array

Error

  • Error(...args: any[]): void
  • Log an error to the console

    Parameters

    • Rest ...args: any[]

      The arguments to log

    Returns void

FetchText

  • FetchText(path: string): Promise<string>
  • Fetches a text from the provided path

    Parameters

    • path: string

      The path to fetch the text from

    Returns Promise<string>

FixateToZero

  • FixateToZero(value: number, range: number): number
  • Fixates a number at the provided range

    Parameters

    • value: number

      The value to fixate

    • range: number

      The range to fixate

    Returns number

GetStringHash

  • GetStringHash(str: string): number
  • Returns the hash of the provided string

    Parameters

    • str: string

      The string to hash

    Returns number

GetTimeStamp

  • GetTimeStamp(): number
  • Returns a high-resolution timestamp

    Returns number

GetUniqueId

  • GetUniqueId(): number

LoadGLSLang

  • LoadGLSLang(): Promise<any>
  • Load the glslang module

    Returns Promise<any>

Log

  • Log(...args: any[]): void
  • Log to the console

    Parameters

    • Rest ...args: any[]

      The arguments to log

    Returns void

Unreachable

  • Unreachable(): void

Warn

  • Warn(...args: any[]): void
  • Log a warning to the console

    Parameters

    • Rest ...args: any[]

      The arguments to log

    Returns void

Generated using TypeDoc