Options
All
  • Public
  • Public/Protected
  • All
Menu

Helps to avoid doubled Shaders and so hopefully preserves some GPU-Memory. All shaders should be retrieved only from the shadermanager by their respective key (set in the geometry classes!).

Hierarchy

Index

Constructors

Private constructor

Properties

keys

keys: string[]

Used to show the available keys in the Manager. Mostly used for import.

lookup

lookup: {}

Represents the store of the data.

Type declaration

Static Private _instance

_instance: ShaderManager

Holds the instance of the Shadermanager.

Accessors

values

  • Returns all saved values.

    Returns Shader[]

Static Instance

  • Holds the instance of the InputManager.

    Returns ShaderManager

Methods

add

  • add(key: string, value: Shader): void
  • Overwrites the default add Method to ensure shaders are compilled after registering them in the Manager.

    Parameters

    • key: string

      Key of the value to be added.

    • value: Shader

      The Shader to be added.

    Returns void

addIfNotExists

  • addIfNotExists(key: string, value: Shader): void
  • Adds a value if it not already exists within the storage.

    Parameters

    • key: string

      The key of the value

    • value: Shader

      The value to be saved

    Returns void

exists

  • exists(key: string): boolean
  • Checks if a key exists in the storage.

    Parameters

    • key: string

      The key to be checked.

    Returns boolean

get

  • get(key: string): Shader | undefined
  • Returns the value of a key or undefined if the key not exists.

    Parameters

    • key: string

      The key of the value to be returned.

    Returns Shader | undefined

getOrAdd

  • Checks for a key and returns its value or adds the default provided.

    Parameters

    • key: string

      The key of the value to be returned.

    • def: Shader

      Defaultvalue that should be added and returned, if the key not exists.

    Returns Shader

remove

  • remove(key: string): void
  • Removes a certain key from the storage.

    Parameters

    • key: string

      The key of the value to be removed.

    Returns void

Generated using TypeDoc