Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/sdl2/mod.ts>Texture#update

SDL2 module for Deno
Latest
method Texture.prototype.update
import { Texture } from "https://deno.land/x/sdl2@0.9.0/mod.ts";

Update the given texture rectangle with new pixel data.

Parameters

pixels: Uint8Array

the raw pixel data in the format of the texture

pitch: number

the number of bytes in a row of pixel data, including padding between lines

optional
rect: Rect

an Rect representing the area to update, or null to update the entire texture