|
Size: 1149
Comment: Update TextureID > Texture*
|
Size: 1058
Comment: update content (w/ Sam); remove 'draft' note
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 3: | Line 3: |
| ||<tablewidth="100%"style="color: rgb(255, 0, 0); text-align: center;">DRAFT|| | |
| Line 20: | Line 19: |
| ||'''rect'''||a pointer to the ,,rectangle of,, ^[[SDL_Rect]] with^ pixels to update, or NULL to update the entire texture|| | ||'''rect'''||a pointer to the rectangle of type [[SDL_Rect]] to update, or NULL to update the entire texture|| |
| Line 25: | Line 24: |
| Returns 0 on success or -1 if the texture is not valid; call [[SDL_GetError]]() for more information. | Returns 0 on success or a negative error code on failure; call [[SDL_GetError]]() for more information. |
| Line 33: | Line 32: |
| This is a fairly slow function. | This is a fairly slow function. It is not intended for use with streaming textures. |
| Line 35: | Line 34: |
| == Related Functions == .[[SDL_CreateTexture]]??? |
SDL_UpdateTexture
Use this function to update the given texture rectangle with new pixel data.
Syntax
int SDL_UpdateTexture(SDL_Texture* texture,
const SDL_Rect* rect,
const void* pixels,
int pitch)
Function Parameters
texture |
the texture to update |
rect |
a pointer to the rectangle of type SDL_Rect to update, or NULL to update the entire texture |
pixels |
the raw pixel data |
pitch |
the number of bytes between rows of pixel data |
Return Value
Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.
Code Examples
You can add your code example here
Remarks
This is a fairly slow function. It is not intended for use with streaming textures.
