From bbeaed58afecdc2c70326581b47733e969e92064 Mon Sep 17 00:00:00 2001 From: xzebra Date: Sat, 6 Feb 2021 01:11:59 +0100 Subject: [PATCH] circle sector functions --- raylib/shapes.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/raylib/shapes.go b/raylib/shapes.go index f3706b0..1d74931 100644 --- a/raylib/shapes.go +++ b/raylib/shapes.go @@ -67,6 +67,28 @@ func DrawCircle(centerX, centerY int32, radius float32, color Color) { C.DrawCircle(ccenterX, ccenterY, cradius, *ccolor) } +// DrawCircleSector - Draw a piece of a circle +func DrawCircleSector(center Vector2, radius float32, startAngle, endAngle, segments int32, color Color) { + ccenter := center.cptr() + cradius := (C.float)(radius) + cstartAngle := (C.int)(startAngle) + cendAngle := (C.int)(endAngle) + csegments := (C.int)(segments) + ccolor := color.cptr() + C.DrawCircleSector(*ccenter, cradius, cstartAngle, cendAngle, csegments, *ccolor) +} + +// DrawCircleSectorLines - +func DrawCircleSectorLines(center Vector2, radius float32, startAngle, endAngle, segments int32, color Color) { + ccenter := center.cptr() + cradius := (C.float)(radius) + cstartAngle := (C.int)(startAngle) + cendAngle := (C.int)(endAngle) + csegments := (C.int)(segments) + ccolor := color.cptr() + C.DrawCircleSectorLines(*ccenter, cradius, cstartAngle, cendAngle, csegments, *ccolor) +} + // DrawCircleGradient - Draw a gradient-filled circle func DrawCircleGradient(centerX, centerY int32, radius float32, color1, color2 Color) { ccenterX := (C.int)(centerX)