Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions SDL3/SDL_LockTexture.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ application level.
You must use [SDL_UnlockTexture](SDL_UnlockTexture)() to unlock the pixels
and apply any changes.

*Note on SDL_LockTexture vs SDL_UpdateTexture:*
On the software renderer, you can write directly to the final destination
with SDL_LockTexture, whereas SDL_UpdateTexture will need to make a copy
from your buffer to SDL's.
On the other renderers, it's probably the same (the GLES2 renderer, for
example, literally just calls SDL_UpdateTexture for its SDL_UnlockTexture
implementation)... but if you ever need a software renderer, this is the
thing that would benefit most from texture locking.
But in real life, with actual GPUs, it doesn't really matter a whole lot.


## Thread Safety

This function should only be called on the main thread.
Expand Down