Function SDL_UnlockTexture

pub unsafe extern "C" fn SDL_UnlockTexture(texture: *mut SDL_Texture)
Available on crate feature dep_sdl3 only.
Expand description

Unlock a texture, uploading the changes to video memory, if needed.

Warning: Please note that SDL_LockTexture() is intended to be write-only; it will not guarantee the previous contents of the texture will be provided. You must fully initialize any area of a texture that you lock before unlocking it, as the pixels might otherwise be uninitialized memory.

Which is to say: locking and immediately unlocking a texture can result in corrupted textures, depending on the renderer in use.

§Parameters

§Thread safety

This function should only be called on the main thread.

§Availability

This function is available since SDL 3.2.0.

§See also