@lightningjs/renderer
    Preparing search index...

    Class CoreTextureManager

    EventEmitter base class

    The eventListeners map is allocated lazily on the first on() call. Many objects (e.g. CoreNodes that never have listeners attached) avoid the cost of allocating an empty {} at construction time.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    frameTime: number = 0

    The current frame time in milliseconds

    This is used to populate the lastRenderableChangeTime property of Texture instances when their renderable state changes.

    Set by stage via updateFrameTime method.

    keyCache: Map<string, Texture> = ...

    Map of textures by cache key

    maxRetryCount: number
    platform: Platform
    renderer: CoreRenderer

    Renderer that this texture manager is associated with

    This MUST be set before the texture manager is used. Otherwise errors will occur when using the texture manager.

    txConstructors: Partial<TextureMap> = {}

    Map of texture constructors by their type name

    Methods

    • Clear all listeners for the given event names by setting their array length to 0, WITHOUT deleting the keys. This keeps the eventListeners object in V8's fast-properties mode and avoids re-allocating the arrays on the next on() call. Use this for objects with a known fixed set of event names (e.g. CoreAnimation, CoreAnimationController).

      Only writes arr.length = 0 when the array is non-empty -- skips the write (and the write barrier on old-gen objects) when already empty, which is the common case after unregisterAnimation() has removed all listeners.

      Parameters

      • events: readonly string[]

      Returns void

    • Destroy the CoreTextureManager and release all internal references.

      Returns void

      Clears the upload queue and key/inverse-key caches so that queued textures can be garbage-collected after a renderer teardown.

    • Check whether this emitter has any listeners registered.

      Parameters

      • Optionalevent: string

        Optional event name. When provided, checks only that event. When omitted, checks all events.

      Returns boolean

      true if at least one listener is registered.

    • Override loadTexture to use the batched approach.

      Parameters

      • texture: Texture

        The texture to load

      • Optionalpriority: boolean

      Returns Promise<void>

    • Process a limited number of uploads.

      Parameters

      • maxProcessingTime: number

        The maximum processing time in milliseconds

      • maxCount: number

        The maximum number of textures to process in this call

      Returns Promise<void>