SDL_UnlockTexture - Man Page

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

Header File

Defined in SDL3/SDL_render.h

Synopsis

#include "SDL3/SDL.h"

void SDL_UnlockTexture(SDL_Texture *texture);

Description

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.

See Also

·(3), SDL_LockTexture(3)

Referenced By

SDL_LockTexture(3), SDL_LockTextureToSurface(3), SDL_UpdateTexture(3).

SDL 3.2.2 Simple Directmedia Layer SDL3 FUNCTIONS