From fac9477f84f0f26e9423692839bba0c7723350c0 Mon Sep 17 00:00:00 2001 From: Allen Ray Date: Sat, 21 Oct 2023 12:15:35 -0400 Subject: [PATCH] Add UnloadImageColors --- raylib/rtextures.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/raylib/rtextures.go b/raylib/rtextures.go index 0a502c2..4300461 100644 --- a/raylib/rtextures.go +++ b/raylib/rtextures.go @@ -166,6 +166,11 @@ func LoadImageColors(img *Image) []color.RGBA { return (*[1 << 24]color.RGBA)(unsafe.Pointer(ret))[0 : img.Width*img.Height] } +// UnloadImageColors - Unload color data loaded with LoadImageColors() +func UnloadImageColors(cols []color.RGBA) { + C.UnloadImageColors((*C.Color)(unsafe.Pointer(&cols[0]))) +} + // LoadImageFromTexture - Get pixel data from GPU texture and return an Image func LoadImageFromTexture(texture Texture2D) *Image { ctexture := texture.cptr()