---
name: "SDL_UnlockTexture"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_UnlockTexture"
---

# SDL\_UnlockTexture(3)

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

## NAME

SDL\_UnlockTexture - 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)](/SDL_LockTexture/3.md)
