summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRay <[email protected]>2022-11-10 10:11:28 +0100
committerRay <[email protected]>2022-11-10 10:11:28 +0100
commit7f68c65406a8321ec192adc6abc3142ac48eb071 (patch)
treeae450ccc5401d9f1b6c0f406eabedfea2326213d
parent84a2a8857229a696852bb97938e1ec2f7b1df892 (diff)
downloadraylib-7f68c65406a8321ec192adc6abc3142ac48eb071.tar.gz
raylib-7f68c65406a8321ec192adc6abc3142ac48eb071.zip
WARNING: REMOVED: `DrawTextureQuad()`
This function can be easely replicated using `DrawtexturePro()` and actually it was doing some assumptions not transparent to the user. Even the function name was confusing. No example was available for it and actually noone requested one example.
-rw-r--r--src/raylib.h5
-rw-r--r--src/rtextures.c13
2 files changed, 2 insertions, 16 deletions
diff --git a/src/raylib.h b/src/raylib.h
index 128711c9..8274ff89 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -1321,10 +1321,9 @@ RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint);
RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2
RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters
RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle
-RLAPI void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters
+RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters
RLAPI void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest.
-RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters
-RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely
+RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely
// Color/pixel related functions
RLAPI Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f
diff --git a/src/rtextures.c b/src/rtextures.c
index 5440ed7c..b367aa19 100644
--- a/src/rtextures.c
+++ b/src/rtextures.c
@@ -3611,19 +3611,6 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2
}
}
-// Draw texture quad with tiling and offset parameters
-// NOTE: Tiling and offset should be provided considering normalized texture values [0..1]
-// i.e tiling = { 1.0f, 1.0f } refers to all texture, offset = { 0.5f, 0.5f } moves texture origin to center
-void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint)
-{
- // WARNING: This solution only works if TEXTURE_WRAP_REPEAT is supported,
- // NPOT textures supported is required and OpenGL ES 2.0 could not support it
- Rectangle source = { offset.x*texture.width, offset.y*texture.height, tiling.x*texture.width, tiling.y*texture.height };
- Vector2 origin = { 0.0f, 0.0f };
-
- DrawTexturePro(texture, source, quad, origin, 0.0f, tint);
-}
-
// Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest.
// NOTE: For tilling a whole texture DrawTextureQuad() is better
void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint)