ImageDrawLineEx function added
This commit is contained in:
parent
19bdd59547
commit
07d2a6efde
2 changed files with 18 additions and 1 deletions
|
@ -315,6 +315,7 @@ var imageDrawPixel func(dst *Image, posX int32, posY int32, col uintptr)
|
|||
var imageDrawPixelV func(dst *Image, position uintptr, col uintptr)
|
||||
var imageDrawLine func(dst *Image, startPosX int32, startPosY int32, endPosX int32, endPosY int32, col uintptr)
|
||||
var imageDrawLineV func(dst *Image, start uintptr, end uintptr, col uintptr)
|
||||
var imageDrawLineEx func(dst *Image, start uintptr, end uintptr, thick int32, col uintptr)
|
||||
var imageDrawCircle func(dst *Image, centerX int32, centerY int32, radius int32, col uintptr)
|
||||
var imageDrawCircleV func(dst *Image, center uintptr, radius int32, col uintptr)
|
||||
var imageDrawCircleLines func(dst *Image, centerX int32, centerY int32, radius int32, col uintptr)
|
||||
|
@ -821,6 +822,7 @@ func init() {
|
|||
purego.RegisterLibFunc(&imageDrawPixelV, raylibDll, "ImageDrawPixelV")
|
||||
purego.RegisterLibFunc(&imageDrawLine, raylibDll, "ImageDrawLine")
|
||||
purego.RegisterLibFunc(&imageDrawLineV, raylibDll, "ImageDrawLineV")
|
||||
purego.RegisterLibFunc(&imageDrawLineEx, raylibDll, "ImageDrawLineEx")
|
||||
purego.RegisterLibFunc(&imageDrawCircle, raylibDll, "ImageDrawCircle")
|
||||
purego.RegisterLibFunc(&imageDrawCircleV, raylibDll, "ImageDrawCircleV")
|
||||
purego.RegisterLibFunc(&imageDrawCircleLines, raylibDll, "ImageDrawCircleLines")
|
||||
|
@ -2683,10 +2685,15 @@ func ImageDrawLine(dst *Image, startPosX int32, startPosY int32, endPosX int32,
|
|||
}
|
||||
|
||||
// ImageDrawLineV - Draw line within an image (Vector version)
|
||||
func ImageDrawLineV(dst *Image, start Vector2, end Vector2, col color.RGBA) {
|
||||
func ImageDrawLineV(dst *Image, start, end Vector2, col color.RGBA) {
|
||||
imageDrawLineV(dst, *(*uintptr)(unsafe.Pointer(&start)), *(*uintptr)(unsafe.Pointer(&end)), *(*uintptr)(unsafe.Pointer(&col)))
|
||||
}
|
||||
|
||||
// ImageDrawLineEx - Draw a line defining thickness within an image
|
||||
func ImageDrawLineEx(dst *Image, start, end Vector2, thick int32, col color.RGBA) {
|
||||
imageDrawLineEx(dst, *(*uintptr)(unsafe.Pointer(&start)), *(*uintptr)(unsafe.Pointer(&end)), thick, *(*uintptr)(unsafe.Pointer(&col)))
|
||||
}
|
||||
|
||||
// ImageDrawCircle - Draw a filled circle within an image
|
||||
func ImageDrawCircle(dst *Image, centerX int32, centerY int32, radius int32, col color.RGBA) {
|
||||
imageDrawCircle(dst, centerX, centerY, radius, *(*uintptr)(unsafe.Pointer(&col)))
|
||||
|
|
|
@ -551,6 +551,16 @@ func ImageDrawLineV(dst *Image, start, end Vector2, col color.RGBA) {
|
|||
C.ImageDrawLineV(cdst, *cstart, *cend, *ccolor)
|
||||
}
|
||||
|
||||
// ImageDrawLineEx - Draw a line defining thickness within an image
|
||||
func ImageDrawLineEx(dst *Image, start, end Vector2, thick int32, col color.RGBA) {
|
||||
cdst := dst.cptr()
|
||||
cstart := start.cptr()
|
||||
cend := end.cptr()
|
||||
cthick := C.int(thick)
|
||||
ccolor := colorCptr(col)
|
||||
C.ImageDrawLineEx(cdst, *cstart, *cend, cthick, *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