Skip to content

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

Parameters

Parameter Default Value Note
texture
pixels

Return value

None.

Notes

Example

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

Clone this wiki locally