DrawRectangleRoundedLinesEx function added (fixes #435)

This commit is contained in:
JupiterRider 2024-11-23 21:24:30 +01:00
parent c364e5b3f5
commit 24c48cde91
2 changed files with 20 additions and 3 deletions

View file

@ -221,6 +221,7 @@ var drawRectangleLines func(posX int32, posY int32, width int32, height int32, c
var drawRectangleLinesEx func(rec uintptr, lineThick float32, col uintptr)
var drawRectangleRounded func(rec uintptr, roundness float32, segments int32, col uintptr)
var drawRectangleRoundedLines func(rec uintptr, roundness float32, segments int32, col uintptr)
var drawRectangleRoundedLinesEx func(rec uintptr, roundness float32, segments int32, lineThick float32, col uintptr)
var drawTriangle func(v1 uintptr, v2 uintptr, v3 uintptr, col uintptr)
var drawTriangleLines func(v1 uintptr, v2 uintptr, v3 uintptr, col uintptr)
var drawTriangleFan func(points *Vector2, pointCount int32, col uintptr)
@ -724,6 +725,7 @@ func init() {
purego.RegisterLibFunc(&drawRectangleLinesEx, raylibDll, "DrawRectangleLinesEx")
purego.RegisterLibFunc(&drawRectangleRounded, raylibDll, "DrawRectangleRounded")
purego.RegisterLibFunc(&drawRectangleRoundedLines, raylibDll, "DrawRectangleRoundedLines")
purego.RegisterLibFunc(&drawRectangleRoundedLinesEx, raylibDll, "DrawRectangleRoundedLinesEx")
purego.RegisterLibFunc(&drawTriangle, raylibDll, "DrawTriangle")
purego.RegisterLibFunc(&drawTriangleLines, raylibDll, "DrawTriangleLines")
purego.RegisterLibFunc(&drawTriangleFan, raylibDll, "DrawTriangleFan")
@ -2135,8 +2137,13 @@ func DrawRectangleRounded(rec Rectangle, roundness float32, segments int32, col
}
// DrawRectangleRoundedLines - Draw rectangle lines with rounded edges
func DrawRectangleRoundedLines(rec Rectangle, roundness float32, segments float32, col color.RGBA) {
drawRectangleRoundedLines(uintptr(unsafe.Pointer(&rec)), roundness, int32(segments), *(*uintptr)(unsafe.Pointer(&col)))
func DrawRectangleRoundedLines(rec Rectangle, roundness float32, segments int32, col color.RGBA) {
drawRectangleRoundedLines(uintptr(unsafe.Pointer(&rec)), roundness, segments, *(*uintptr)(unsafe.Pointer(&col)))
}
// DrawRectangleRoundedLinesEx - Draw rectangle with rounded edges outline
func DrawRectangleRoundedLinesEx(rec Rectangle, roundness float32, segments int32, lineThick float32, col color.RGBA) {
drawRectangleRoundedLinesEx(uintptr(unsafe.Pointer(&rec)), roundness, segments, lineThick, *(*uintptr)(unsafe.Pointer(&col)))
}
// DrawTriangle - Draw a color-filled triangle (vertex in counter-clockwise order!)