mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-03 08:28:30 +00:00
Add safety notes to 'Update_' functions
This commit is contained in:
@@ -4337,14 +4337,17 @@ void UnloadRenderTexture(RenderTexture2D target)
|
||||
}
|
||||
|
||||
// Update GPU texture with new data
|
||||
// NOTE: pixels data must match texture.format
|
||||
// NOTE 1: pixels data must match texture.format
|
||||
// NOTE 2: pixels data must contain at least as many pixels as texture
|
||||
void UpdateTexture(Texture2D texture, const void *pixels)
|
||||
{
|
||||
rlUpdateTexture(texture.id, 0, 0, texture.width, texture.height, texture.format, pixels);
|
||||
}
|
||||
|
||||
// Update GPU texture rectangle with new data
|
||||
// NOTE: pixels data must match texture.format
|
||||
// NOTE 1: pixels data must match texture.format
|
||||
// NOTE 2: pixels data must contain as many pixels as rec contains
|
||||
// NOTE 3: rec must fit completely within texture's width and height
|
||||
void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels)
|
||||
{
|
||||
rlUpdateTexture(texture.id, (int)rec.x, (int)rec.y, (int)rec.width, (int)rec.height, texture.format, pixels);
|
||||
|
Reference in New Issue
Block a user