Merge pull request #210 from alessandrojcm/master
Added ImageDrawLine and ImageDrawLineV functions to rtexture.go
This commit is contained in:
commit
892ce4892c
1 changed files with 20 additions and 0 deletions
|
@ -384,6 +384,26 @@ func ImageDraw(dst, src *Image, srcRec, dstRec Rectangle, tint color.RGBA) {
|
|||
C.ImageDraw(cdst, *csrc, *csrcRec, *cdstRec, *ctint)
|
||||
}
|
||||
|
||||
// ImageDrawLine - Draw line within an image
|
||||
func ImageDrawLine(dst *Image, startPosX, startPosY, endPosX, endPosY int32, col color.RGBA) {
|
||||
cdst := dst.cptr()
|
||||
cstartPosX := (C.int)(startPosX)
|
||||
cstartPosY := (C.int)(startPosY)
|
||||
cendPosX := (C.int)(endPosX)
|
||||
cendPosY := (C.int)(endPosY)
|
||||
ccolor := colorCptr(col)
|
||||
C.ImageDrawLine(cdst, cstartPosX, cstartPosY, cendPosX, cendPosY, *ccolor)
|
||||
}
|
||||
|
||||
// ImageDrawLineV - Draw line within an image, vector version
|
||||
func ImageDrawLineV(dst *Image, start, end Vector2, col color.RGBA) {
|
||||
cdst := dst.cptr()
|
||||
cstart := start.cptr()
|
||||
cend := end.cptr()
|
||||
ccolor := colorCptr(col)
|
||||
C.ImageDrawLineV(cdst, *cstart, *cend, *ccolor)
|
||||
}
|
||||
|
||||
// ImageDrawCircle - Draw a filled circle within an image
|
||||
func ImageDrawCircle(dst *Image, centerX, centerY, radius int32, col color.RGBA) {
|
||||
cdst := dst.cptr()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue