Add DrawTextureTiled, fixes #170

This commit is contained in:
Milan Nikolic 2022-03-23 14:09:10 +01:00
parent b144285481
commit 7b9bbbba96
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75

View file

@ -632,3 +632,15 @@ func DrawTexturePro(texture Texture2D, sourceRec, destRec Rectangle, origin Vect
ctint := colorCptr(tint) ctint := colorCptr(tint)
C.DrawTexturePro(*ctexture, *csourceRec, *cdestRec, *corigin, crotation, *ctint) C.DrawTexturePro(*ctexture, *csourceRec, *cdestRec, *corigin, crotation, *ctint)
} }
// DrawTextureTiled - Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest
func DrawTextureTiled(texture Texture2D, sourceRec, destRec Rectangle, origin Vector2, rotation float32, scale float32, tint color.RGBA) {
ctexture := texture.cptr()
csourceRec := sourceRec.cptr()
cdestRec := destRec.cptr()
corigin := origin.cptr()
crotation := (C.float)(rotation)
cscale := (C.float)(scale)
ctint := colorCptr(tint)
C.DrawTextureTiled(*ctexture, *csourceRec, *cdestRec, *corigin, crotation, cscale, *ctint)
}