SDL_UnlockTexture(3)

SDL_UnlockTexture3

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

Usage

#include "SDL3/SDL.h"

void SDL_UnlockTexture(SDL_Texture *texture);

Header file

Defined in SDL3/SDL_render.h

Overview

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.

Function parameters

texture

a texture locked by SDL_LockTexture ().

Thread safety

This function should only be called on the main thread.

Availability

This function is available since SDL 3.2.0.

From libsdl3-doc 3.2.10+ds-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.