Textures & surfacesSDL 3.2

SDL_UnlockTexture

Finishes writing a locked texture and uploads the new pixels.

Signature

void SDL_UnlockTexture(SDL_Texture *texture);

How it works

After this call the pointer from SDL_LockTexture is invalid. Lock and unlock once per frame, not once per pixel: each pair is an upload.

Parameters

textureSDL_Texture *

The locked texture.

Example

example.cpp
1SDL_UnlockTexture(screen);
2SDL_RenderTexture(renderer, screen, nullptr, nullptr);
Official SDL wiki