Function sdl2_sys::SDL_UpdateTexture
source ยท pub unsafe extern "C" fn SDL_UpdateTexture(
texture: *mut SDL_Texture,
rect: *const SDL_Rect,
pixels: *const c_void,
pitch: c_int,
) -> c_int
Expand description
Update the given texture rectangle with new pixel data.
The pixel data must be in the pixel format of the texture. Use SDL_QueryTexture() to query the pixel format of the texture.
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.
\param texture the texture to update \param rect an SDL_Rect structure representing the area to update, or NULL to update the entire texture \param pixels the raw pixel data in the format of the texture \param pitch the number of bytes in a row of pixel data, including padding between lines \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.
\since This function is available since SDL 2.0.0.
\sa SDL_CreateTexture \sa SDL_LockTexture \sa SDL_UnlockTexture