summaryrefslogtreecommitdiffhomepage
path: root/src/textures.c
diff options
context:
space:
mode:
authorRay <[email protected]>2020-06-25 16:26:59 +0200
committerRay <[email protected]>2020-06-25 16:26:59 +0200
commitba39a1b304bc8af27d7cd319a06e4c4767997f4e (patch)
treec3d85f4402e3707be55a476496b890e1d21cdb7d /src/textures.c
parent25fb24ba7d8cb90a32ae3b7a57f4a1a87a8f7319 (diff)
downloadraylib-ba39a1b304bc8af27d7cd319a06e4c4767997f4e.tar.gz
raylib-ba39a1b304bc8af27d7cd319a06e4c4767997f4e.zip
ADDED: UpdateTextureRec()
Diffstat (limited to 'src/textures.c')
-rw-r--r--src/textures.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/textures.c b/src/textures.c
index 8f93383e..85a7c77e 100644
--- a/src/textures.c
+++ b/src/textures.c
@@ -2798,7 +2798,14 @@ void UnloadRenderTexture(RenderTexture2D target)
// NOTE: pixels data must match texture.format
void UpdateTexture(Texture2D texture, const void *pixels)
{
- rlUpdateTexture(texture.id, texture.width, texture.height, texture.format, 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
+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);
}
// Get pixel data from GPU texture and return an Image