Add new functions

This commit is contained in:
Milan Nikolic 2022-08-27 16:51:14 +02:00
parent 70200c3151
commit cf628212a1
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75
4 changed files with 121 additions and 21 deletions

View file

@ -622,15 +622,14 @@ func DrawTextureRec(texture Texture2D, sourceRec Rectangle, position Vector2, ti
C.DrawTextureRec(*ctexture, *csourceRec, *cposition, *ctint)
}
// DrawTexturePro - Draw a part of a texture defined by a rectangle with 'pro' parameters
func DrawTexturePro(texture Texture2D, sourceRec, destRec Rectangle, origin Vector2, rotation float32, tint color.RGBA) {
// DrawTextureQuad - Draw texture quad with tiling and offset parameters
func DrawTextureQuad(texture Texture2D, tiling, offset Vector2, rectangle Rectangle, tint color.RGBA) {
ctexture := texture.cptr()
csourceRec := sourceRec.cptr()
cdestRec := destRec.cptr()
corigin := origin.cptr()
crotation := (C.float)(rotation)
ctiling := tiling.cptr()
coffset := offset.cptr()
crectangle := rectangle.cptr()
ctint := colorCptr(tint)
C.DrawTexturePro(*ctexture, *csourceRec, *cdestRec, *corigin, crotation, *ctint)
C.DrawTextureQuad(*ctexture, *ctiling, *coffset, *crectangle, *ctint)
}
// DrawTextureTiled - Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest
@ -644,3 +643,14 @@ func DrawTextureTiled(texture Texture2D, sourceRec, destRec Rectangle, origin Ve
ctint := colorCptr(tint)
C.DrawTextureTiled(*ctexture, *csourceRec, *cdestRec, *corigin, crotation, cscale, *ctint)
}
// DrawTexturePro - Draw a part of a texture defined by a rectangle with 'pro' parameters
func DrawTexturePro(texture Texture2D, sourceRec, destRec Rectangle, origin Vector2, rotation float32, tint color.RGBA) {
ctexture := texture.cptr()
csourceRec := sourceRec.cptr()
cdestRec := destRec.cptr()
corigin := origin.cptr()
crotation := (C.float)(rotation)
ctint := colorCptr(tint)
C.DrawTexturePro(*ctexture, *csourceRec, *cdestRec, *corigin, crotation, *ctint)
}