triangle functions
This commit is contained in:
parent
7d41c2d3df
commit
1b2825bc0c
1 changed files with 16 additions and 0 deletions
|
@ -281,6 +281,22 @@ func DrawTriangleLines(v1, v2, v3 Vector2, color Color) {
|
||||||
C.DrawTriangleLines(*cv1, *cv2, *cv3, *ccolor)
|
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)
|
// DrawPoly - Draw a regular polygon (Vector version)
|
||||||
func DrawPoly(center Vector2, sides int32, radius, rotation float32, color Color) {
|
func DrawPoly(center Vector2, sides int32, radius, rotation float32, color Color) {
|
||||||
ccenter := center.cptr()
|
ccenter := center.cptr()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue