table of contents
- testing 3.2.10+ds-1
- unstable 3.2.10+ds-1
- experimental 3.2.16+ds-1
SDL_UpdateTexture(3) | SDL3 FUNCTIONS | SDL_UpdateTexture(3) |
NAME¶
SDL_UpdateTexture - Update the given texture rectangle with new pixel data.
SYNOPSIS¶
#include <SDL3/SDL_render.h>
bool SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch);
DESCRIPTION¶
The pixel data must be in the pixel format of the texture, which can be queried using the SDL_PROP_TEXTURE_FORMAT_NUMBER property.
This is a fairly slow function, intended for use with static textures that do not change often.
If the texture is intended to be updated often, it is preferred to create the texture as streaming and use the locking functions referenced below. While this function will work with streaming textures, for optimization reasons you may not get the pixels back if you lock the texture afterward.
FUNCTION PARAMETERS¶
RETURN VALUE¶
for more information.
THREAD SAFETY¶
This function should only be called on the main thread.
AVAILABILITY¶
This function is available since SDL 3.2.0.
SEE ALSO¶
SDL_LockTexture(3), SDL_UnlockTexture(3), SDL_UpdateNVTexture(3), SDL_UpdateYUVTexture(3)
SDL 3.2.16 | Simple Directmedia Layer |