omega-game-engine
    Preparing search index...

    Class EngineCacheAbstract

    A static class that manages the caching of various engine assets such as textures, meshes, and shader code. *

    Index

    Constructors

    Methods

    • Clears all cached data, including textures, meshes, and shader code.

      Returns void

    • Retrieves mesh data parsed from an OBJ file from the cache or loads, parses, and caches it if not present.

      Parameters

      • uri: string

        The URI of the OBJ file. *

      Returns Promise<MeshData>

      • A promise that resolves with the mesh data.
    • Retrieves a 2D texture from the cache or loads and caches it if not present.

      Parameters

      • uri: string

        The URI of the texture. *

      • Optionalgl: WebGL2RenderingContext

        The WebGL2 rendering context. *

      Returns Promise<Texture>

      • The cached or newly loaded Texture instance.
    • Retrieves a Cube texture from the cache or loads and caches it if not present.

      Parameters

      • uris: ICubemapSides
      • Optionalgl: WebGL2RenderingContext

        The WebGL2 rendering context. *

      Returns Promise<CubemapTexture>

      • A promise that resolves with the cached or newly loaded CubemapTexture instance.
    • Retrieves a default white texture from the cache or loads and caches it if not present. This texture is loaded from "assets/default/white.jpg".

      Parameters

      • gl: WebGL2RenderingContext

        The WebGL2 rendering context.

      Returns Promise<Texture>

      • A promise that resolves with the cached or newly loaded white Texture instance.
    • Retrieves a default white cubemap texture from the cache, maintaining the URI signature for engine compatibility.

      Parameters

      • Optionalgl: WebGL2RenderingContext

        The WebGL2 rendering context.

      Returns Promise<CubemapTexture>

      • A promise that resolves with the cached or newly created white CubemapTexture instance.
    • Retrieves shader source code from the cache or loads and caches it if not present.

      Parameters

      • uri: string

        The URI of the shader source file. *

      Returns Promise<string>

      • A promise that resolves with the shader source code as a string.
    • Parameters

      • key: string
      • value: any

      Returns void