triangle functions

This commit is contained in:
xzebra 2021-02-06 01:12:40 +01:00
parent 7d41c2d3df
commit 1b2825bc0c
No known key found for this signature in database
GPG key ID: 6C835ADAF247138C

View file

@ -281,6 +281,22 @@ func DrawTriangleLines(v1, v2, v3 Vector2, color Color) {
C.DrawTriangleLines(*cv1, *cv2, *cv3, *ccolor)
}
// DrawTriangleFan - Draw a triangle fan defined by points
func DrawTriangleFan(points []Vector2, color Color) {
cpoints := (*C.Vector2)(unsafe.Pointer(&points[0]))
cpointsCount := (C.int)(int32(len(points)))
ccolor := color.cptr()
C.DrawTriangleLines(*cpoints, cpointsCount, *ccolor)
}
// DrawTriangleStrip - Draw a triangle strip defined by points
func DrawTriangleStrip(points []Vector2, color Color) {
cpoints := (*C.Vector2)(unsafe.Pointer(&points[0]))
cpointsCount := (C.int)(int32(len(points)))
ccolor := color.cptr()
C.DrawTriangleStrip(*cpoints, cpointsCount, *ccolor)
}
// DrawPoly - Draw a regular polygon (Vector version)
func DrawPoly(center Vector2, sides int32, radius, rotation float32, color Color) {
ccenter := center.cptr()