better to use the using existing method by passing the required []color.RGBA instead of the unsafe.Pointer

This commit is contained in:
Palessan 2024-06-28 15:11:11 +03:00
parent f529bc2897
commit 6c3961f894
2 changed files with 8 additions and 14 deletions

View file

@ -246,14 +246,6 @@ func UpdateTexture(texture Texture2D, pixels []color.RGBA) {
C.UpdateTexture(*ctexture, cpixels)
}
// UpdateTexture - Update GPU texture with new data
// NOTE: pixels data must match texture.format
func UpdateTextureUnsafe(texture Texture2D, pixels unsafe.Pointer) {
ctexture := texture.cptr()
cpixels := pixels
C.UpdateTexture(*ctexture, cpixels)
}
// UpdateTextureRec - Update GPU texture rectangle with new data
func UpdateTextureRec(texture Texture2D, rec Rectangle, pixels []color.RGBA) {
ctexture := texture.cptr()