mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-03 08:28:30 +00:00
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.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user