@lightningjs/renderer
    Preparing search index...

    Interface WebGlCoreCtxTexture

    A wrapper around a WebGLTexture that handles loading the texture data from a Texture source and uploading it to the GPU as well as freeing the uploaded texture.

    When accessing the ctxTexture property, the texture will be loaded if it hasn't been already. ctxTexture will always return a valid WebGLTexture and trigger the loading/uploading of the texture's data if it hasn't been loaded yet.

    interface WebGlCoreCtxTexture {
        _nativeCtxTexture: null | WebGLTexture;
        glw: GlContextWrapper;
        state: "loaded" | "failed" | "loading" | "freed";
        textureSource: Texture;
        txCoords: Bound;
        get ctxTexture(): null | WebGLTexture;
        get h(): number;
        get renderable(): boolean;
        get w(): number;
        createNativeCtxTexture(): null | WebGLTexture;
        free(): void;
        load(): Promise<void>;
        onLoadRequest(): Promise<Dimensions>;
        release(): void;
        setTextureMemUse(byteSize: number): void;
    }

    Hierarchy

    • CoreContextTexture
      • WebGlCoreCtxTexture
    Index

    Properties

    _nativeCtxTexture: null | WebGLTexture = null
    glw: GlContextWrapper
    state: "loaded" | "failed" | "loading" | "freed" = 'freed'
    textureSource: Texture
    txCoords: Bound = ...

    Accessors

    Methods

    • Create native context texture asynchronously

      Returns null | WebGLTexture

      Promise that resolves to the native WebGL texture or null on failure

      When this method resolves, the returned texture will be bound to the GL context state and fully ready for use. This ensures proper GPU resource allocation timing.

    • Load the texture data from the Texture source and upload it to the GPU

      Returns Promise<void>

      This method is called automatically when accessing the ctxTexture property if the texture hasn't been loaded yet. But it can also be called manually to force the texture to be pre-loaded prior to accessing the ctxTexture property.