GetShapesTexture() and GetShapesTextureRectangle() added
This commit is contained in:
parent
972563ca1f
commit
ff18bb497b
2 changed files with 32 additions and 0 deletions
|
@ -190,6 +190,8 @@ var getGestureDragAngle func() float32
|
||||||
var getGesturePinchVector func() uintptr
|
var getGesturePinchVector func() uintptr
|
||||||
var getGesturePinchAngle func() float32
|
var getGesturePinchAngle func() float32
|
||||||
var setShapesTexture func(texture uintptr, source uintptr)
|
var setShapesTexture func(texture uintptr, source uintptr)
|
||||||
|
var getShapesTexture func(texture uintptr)
|
||||||
|
var getShapesTextureRectangle func(rec uintptr)
|
||||||
var drawPixel func(posX int32, posY int32, col uintptr)
|
var drawPixel func(posX int32, posY int32, col uintptr)
|
||||||
var drawPixelV func(position uintptr, col uintptr)
|
var drawPixelV func(position uintptr, col uintptr)
|
||||||
var drawLine func(startPosX int32, startPosY int32, endPosX int32, endPosY int32, col uintptr)
|
var drawLine func(startPosX int32, startPosY int32, endPosX int32, endPosY int32, col uintptr)
|
||||||
|
@ -691,6 +693,8 @@ func init() {
|
||||||
purego.RegisterLibFunc(&getGesturePinchVector, raylibDll, "GetGesturePinchVector")
|
purego.RegisterLibFunc(&getGesturePinchVector, raylibDll, "GetGesturePinchVector")
|
||||||
purego.RegisterLibFunc(&getGesturePinchAngle, raylibDll, "GetGesturePinchAngle")
|
purego.RegisterLibFunc(&getGesturePinchAngle, raylibDll, "GetGesturePinchAngle")
|
||||||
purego.RegisterLibFunc(&setShapesTexture, raylibDll, "SetShapesTexture")
|
purego.RegisterLibFunc(&setShapesTexture, raylibDll, "SetShapesTexture")
|
||||||
|
purego.RegisterLibFunc(&getShapesTexture, raylibDll, "GetShapesTexture")
|
||||||
|
purego.RegisterLibFunc(&getShapesTextureRectangle, raylibDll, "GetShapesTextureRectangle")
|
||||||
purego.RegisterLibFunc(&drawPixel, raylibDll, "DrawPixel")
|
purego.RegisterLibFunc(&drawPixel, raylibDll, "DrawPixel")
|
||||||
purego.RegisterLibFunc(&drawPixelV, raylibDll, "DrawPixelV")
|
purego.RegisterLibFunc(&drawPixelV, raylibDll, "DrawPixelV")
|
||||||
purego.RegisterLibFunc(&drawLine, raylibDll, "DrawLine")
|
purego.RegisterLibFunc(&drawLine, raylibDll, "DrawLine")
|
||||||
|
@ -1975,6 +1979,20 @@ func SetShapesTexture(texture Texture2D, source Rectangle) {
|
||||||
setShapesTexture(uintptr(unsafe.Pointer(&texture)), uintptr(unsafe.Pointer(&source)))
|
setShapesTexture(uintptr(unsafe.Pointer(&texture)), uintptr(unsafe.Pointer(&source)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetShapesTexture - Get texture that is used for shapes drawing
|
||||||
|
func GetShapesTexture() Texture2D {
|
||||||
|
var texture Texture2D
|
||||||
|
getShapesTexture(uintptr(unsafe.Pointer(&texture)))
|
||||||
|
return texture
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetShapesTextureRectangle - Get texture source rectangle that is used for shapes drawing
|
||||||
|
func GetShapesTextureRectangle() Rectangle {
|
||||||
|
var rec Rectangle
|
||||||
|
getShapesTextureRectangle(uintptr(unsafe.Pointer(&rec)))
|
||||||
|
return rec
|
||||||
|
}
|
||||||
|
|
||||||
// DrawPixel - Draw a pixel
|
// DrawPixel - Draw a pixel
|
||||||
func DrawPixel(posX int32, posY int32, col color.RGBA) {
|
func DrawPixel(posX int32, posY int32, col color.RGBA) {
|
||||||
drawPixel(posX, posY, *(*uintptr)(unsafe.Pointer(&col)))
|
drawPixel(posX, posY, *(*uintptr)(unsafe.Pointer(&col)))
|
||||||
|
|
|
@ -17,6 +17,20 @@ func SetShapesTexture(texture Texture2D, source Rectangle) {
|
||||||
C.SetShapesTexture(*ctexture, *csource)
|
C.SetShapesTexture(*ctexture, *csource)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetShapesTexture - Get texture that is used for shapes drawing
|
||||||
|
func GetShapesTexture() Texture2D {
|
||||||
|
ret := C.GetShapesTexture()
|
||||||
|
v := newTexture2DFromPointer(unsafe.Pointer(&ret))
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetShapesTextureRectangle - Get texture source rectangle that is used for shapes drawing
|
||||||
|
func GetShapesTextureRectangle() Rectangle {
|
||||||
|
ret := C.GetShapesTextureRectangle()
|
||||||
|
v := newRectangleFromPointer(unsafe.Pointer(&ret))
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
|
||||||
// DrawPixel - Draw a pixel
|
// DrawPixel - Draw a pixel
|
||||||
func DrawPixel(posX, posY int32, col color.RGBA) {
|
func DrawPixel(posX, posY int32, col color.RGBA) {
|
||||||
cposX := (C.int)(posX)
|
cposX := (C.int)(posX)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue