-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.UpdateTexture
JoeStrout edited this page Apr 29, 2026
·
3 revisions
Update GPU texture with new data NOTE 1: pixels data must match texture.format NOTE 2: pixels data must contain at least as many pixels as texture
| Parameter | Default Value | Note |
|---|---|---|
| texture | ||
| pixels |
None.
tex = raylib.LoadTexture("sprite.png")
// Build raw RGBA pixel data and push it to the GPU
pixels = char(255) * 4 * tex.width * tex.height // all white
raylib.UpdateTexture tex, pixels
raylib.UnloadTexture tex