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.

Remarks

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.

Hierarchy

  • CoreContextTexture
    • WebGlCoreCtxTexture

Constructors

Properties

_h: number = 0
_nativeCtxTexture: null | WebGLTexture = null
_state: "loaded" | "failed" | "loading" | "freed" = 'freed'
_w: number = 0
glw: WebGlContextWrapper
textureSource: Texture

Accessors

Methods

  • Create native context texture

    Returns null | WebGLTexture

    Remarks

    When this method returns the returned texture will be bound to the GL context state.

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

    Returns void

    Remarks

    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.

Generated using TypeDoc