API reference
Preparing search index…

GPU texture with background image decoding and ordered pixel uploads.

Source & inheritance
Member directory23

Constructors

Properties

Methods

Constructors

Methods

  • Synchronously deep-copies source into this texture, preserving wrapper identity and returning this.

    Parameters

    source
    Readonly

    Returns

    this
    Source & inheritance
  • Generates mipmap levels for minification and returns whether it succeeded; regenerate after updating pixels.

    Returns

    boolean
    Source & inheritance
  • Returns the OpenGL texture identifier, or 0 for an empty texture; retain the texture object while using it.

    Returns

    number
    Source & inheritance
  • Returns whether smooth filtering is enabled.

    Returns

    boolean
    Source & inheritance
  • Returns whether the texture uses the sRGB format.

    Returns

    boolean
    Source & inheritance
  • Decodes a file asynchronously, then uploads pixels and returns success; area uses pixel coordinates and defaults to the whole image.

    Parameters

    filename
    string
    sRgb
    boolean = false
    areaOptional

    Returns

    Promise<boolean>
    Source & inheritance
  • Decodes encoded image bytes asynchronously, then uploads pixels and returns success; sRgb defaults to false.

    Parameters

    data
    Uint8Array
    sRgb
    boolean = false
    areaOptional

    Returns

    Promise<boolean>
    Source & inheritance
  • Successful resize leaves pixel contents undefined, as in SFML.

    Parameters

    size
    Readonly<Vector2u>
    sRgb
    boolean = false

    Returns

    boolean
    Source & inheritance
  • Sets whether coordinates outside the texture repeat it; false uses edge pixels.

    Parameters

    repeated
    boolean

    Returns

    void
    Source & inheritance
  • Enables or disables smooth texture filtering.

    Parameters

    smooth
    boolean

    Returns

    void
    Source & inheritance
  • Synchronously swaps pixels and settings after submitting recorded draws; cannot be used on borrowed texture views.

    Parameters

    other

    Returns

    void
    Source & inheritance
  • Synchronously updates the entire texture; pixels must contain exactly width

    • height * 4 RGBA8 bytes.

    Parameters

    pixels
    Uint8Array

    Returns

    void
    Source & inheritance
  • Uploads an RGBA8 pixel block of size to dest; all coordinates and dimensions are in pixels.

    Parameters

    pixels
    Uint8Array
    size
    Readonly<Vector2u>
    dest
    Readonly<Vector2u>

    Returns

    void
    Source & inheritance
  • Copies image, texture or window contents to dest (default origin); the destination region must fit the entire source.

    Parameters

    source

        | Image
        | Readonly<
            Pick<
                Texture,
                | "getSize"
                | typeof graphicsNative
                | typeof textureId
                | typeof textureOwner
                | "copyToImage"
                | "isSmooth"
                | "isRepeated"
                | "isSrgb"
                | "getNativeHandle",
            >,
        >
        | Window
    destOptional
    Readonly<Vector2u>

    Returns

    void
    Source & inheritance
  • Bind in the current GL context; retain the texture while using its ID.

    Parameters

    texture

        | null
        | Readonly<
            Pick<
                Texture,
                | "getSize"
                | typeof graphicsNative
                | typeof textureId
                | typeof textureOwner
                | "copyToImage"
                | "isSmooth"
                | "isRepeated"
                | "isSrgb"
                | "getNativeHandle",
            >,
        >
    coordinateType
    CoordinateType = CoordinateType.Normalized

    Returns

    void
    Source & inheritance
  • Returns the maximum texture side length supported by the current graphics card, in pixels.

    Returns

    number
    Source & inheritance

Symbol members

"[graphicsNative]": NativeGraphicsHandle<"texture">
Source & inheritance
"[textureId]": number
Source & inheritance
"[textureOwner]"?: PendingTarget
Source & inheritance

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0