From e39e45824db79623fa4c7b55a606ca79fc27659e Mon Sep 17 00:00:00 2001 From: Lambert Wang <77245864+lambert-wang@users.noreply.github.com> Date: Mon, 10 May 2021 11:08:58 -0700 Subject: Add RenderPolyLinesEx routine (#1758) Co-authored-by: Lambert Wang --- examples/shapes/shapes_basic_shapes.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'examples') diff --git a/examples/shapes/shapes_basic_shapes.c b/examples/shapes/shapes_basic_shapes.c index cd165d2e..086de774 100644 --- a/examples/shapes/shapes_basic_shapes.c +++ b/examples/shapes/shapes_basic_shapes.c @@ -39,27 +39,32 @@ int main(void) DrawText("some basic shapes available on raylib", 20, 20, 20, DARKGRAY); - DrawCircle(screenWidth/4, 120, 35, DARKBLUE); + // Circle shapes and lines + DrawCircle(screenWidth/5, 120, 35, DARKBLUE); + DrawCircleGradient(screenWidth/5, 220, 60, GREEN, SKYBLUE); + DrawCircleLines(screenWidth/5, 340, 80, DARKBLUE); + // Rectangle shapes and ines DrawRectangle(screenWidth/4*2 - 60, 100, 120, 60, RED); - DrawRectangleLines(screenWidth/4*2 - 40, 320, 80, 60, ORANGE); // NOTE: Uses QUADS internally, not lines DrawRectangleGradientH(screenWidth/4*2 - 90, 170, 180, 130, MAROON, GOLD); + DrawRectangleLines(screenWidth/4*2 - 40, 320, 80, 60, ORANGE); // NOTE: Uses QUADS internally, not lines + // Triangle shapes and lines DrawTriangle((Vector2){screenWidth/4.0f *3.0f, 80.0f}, (Vector2){screenWidth/4.0f *3.0f - 60.0f, 150.0f}, (Vector2){screenWidth/4.0f *3.0f + 60.0f, 150.0f}, VIOLET); - DrawPoly((Vector2){screenWidth/4*3, 320}, 6, 80, 0, BROWN); + DrawTriangleLines((Vector2){screenWidth/4.0f*3.0f, 160.0f}, + (Vector2){screenWidth/4.0f*3.0f - 20.0f, 230.0f}, + (Vector2){screenWidth/4.0f*3.0f + 20.0f, 230.0f}, DARKBLUE); - DrawCircleGradient(screenWidth/4, 220, 60, GREEN, SKYBLUE); + // Polygon shapes and lines + DrawPoly((Vector2){screenWidth/4*3, 320}, 6, 80, 0, BROWN); + DrawPolyLinesEx((Vector2){screenWidth/4*3, 320}, 6, 80, 0, 6, BEIGE); // NOTE: We draw all LINES based shapes together to optimize internal drawing, // this way, all LINES are rendered in a single draw pass DrawLine(18, 42, screenWidth - 18, 42, BLACK); - DrawCircleLines(screenWidth/4, 340, 80, DARKBLUE); - DrawTriangleLines((Vector2){screenWidth/4.0f*3.0f, 160.0f}, - (Vector2){screenWidth/4.0f*3.0f - 20.0f, 230.0f}, - (Vector2){screenWidth/4.0f*3.0f + 20.0f, 230.0f}, DARKBLUE); EndDrawing(); //---------------------------------------------------------------------------------- } -- cgit v1.2.3