From f7e848f9f819aa8eabc6de7eda16353cb0ce7b5c Mon Sep 17 00:00:00 2001 From: Milan Nikolic Date: Fri, 4 Sep 2020 20:21:20 +0200 Subject: [PATCH] Add Ellipse functions, fixes #107 --- raylib/shapes.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/raylib/shapes.go b/raylib/shapes.go index facb3e8..f3706b0 100644 --- a/raylib/shapes.go +++ b/raylib/shapes.go @@ -94,6 +94,26 @@ func DrawCircleLines(centerX, centerY int32, radius float32, color Color) { C.DrawCircleLines(ccenterX, ccenterY, cradius, *ccolor) } +// DrawEllipse - Draw ellipse +func DrawEllipse(centerX, centerY int32, radiusH, radiusV float32, color Color) { + ccenterX := (C.int)(centerX) + ccenterY := (C.int)(centerY) + cradiusH := (C.float)(radiusH) + cradiusV := (C.float)(radiusV) + ccolor := color.cptr() + C.DrawEllipse(ccenterX, ccenterY, cradiusH, cradiusV, *ccolor) +} + +// DrawEllipseLines - Draw ellipse outline +func DrawEllipseLines(centerX, centerY int32, radiusH, radiusV float32, color Color) { + ccenterX := (C.int)(centerX) + ccenterY := (C.int)(centerY) + cradiusH := (C.float)(radiusH) + cradiusV := (C.float)(radiusV) + ccolor := color.cptr() + C.DrawEllipseLines(ccenterX, ccenterY, cradiusH, cradiusV, *ccolor) +} + // DrawRectangle - Draw a color-filled rectangle func DrawRectangle(posX, posY, width, height int32, color Color) { cposX := (C.int)(posX)