diff options
| author | Lambert Wang <[email protected]> | 2021-05-10 11:08:58 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-05-10 20:08:58 +0200 |
| commit | e39e45824db79623fa4c7b55a606ca79fc27659e (patch) | |
| tree | de83c511f80faeb0832f11ddf65082bf814d63ed /examples/shapes | |
| parent | 5d831f3f1853217c27e9c80a12caecf5b8f3133a (diff) | |
| download | raylib-e39e45824db79623fa4c7b55a606ca79fc27659e.tar.gz raylib-e39e45824db79623fa4c7b55a606ca79fc27659e.zip | |
Add RenderPolyLinesEx routine (#1758)
Co-authored-by: Lambert Wang <[email protected]>
Diffstat (limited to 'examples/shapes')
| -rw-r--r-- | examples/shapes/shapes_basic_shapes.c | 21 |
1 files changed, 13 insertions, 8 deletions
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(); //---------------------------------------------------------------------------------- } |
