Fix build
This commit is contained in:
parent
041fa24e1f
commit
cade73de7d
1 changed files with 3 additions and 3 deletions
|
@ -23,7 +23,7 @@ func (i *Image) ToImage() image.Image {
|
||||||
// Get pixel data from image (RGBA 32bit)
|
// Get pixel data from image (RGBA 32bit)
|
||||||
cimg := i.cptr()
|
cimg := i.cptr()
|
||||||
ret := C.GetImageData(*cimg)
|
ret := C.GetImageData(*cimg)
|
||||||
pixels := (*[1 << 30]uint8)(unsafe.Pointer(ret))[0 : i.Width*i.Height*4]
|
pixels := (*[1 << 24]uint8)(unsafe.Pointer(ret))[0 : i.Width*i.Height*4]
|
||||||
|
|
||||||
img.Pix = pixels
|
img.Pix = pixels
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ func UnloadRenderTexture(target RenderTexture2D) {
|
||||||
func GetImageData(img *Image) []Color {
|
func GetImageData(img *Image) []Color {
|
||||||
cimg := img.cptr()
|
cimg := img.cptr()
|
||||||
ret := C.GetImageData(*cimg)
|
ret := C.GetImageData(*cimg)
|
||||||
return (*[1 << 30]Color)(unsafe.Pointer(ret))[0 : img.Width*img.Height]
|
return (*[1 << 24]Color)(unsafe.Pointer(ret))[0 : img.Width*img.Height]
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetPixelDataSize - Get pixel data size in bytes (image or texture)
|
// GetPixelDataSize - Get pixel data size in bytes (image or texture)
|
||||||
|
@ -152,7 +152,7 @@ func GetTextureData(texture Texture2D) *Image {
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateTexture - Update GPU texture with new data
|
// UpdateTexture - Update GPU texture with new data
|
||||||
func UpdateTexture(texture Texture2D, pixels []byte) {
|
func UpdateTexture(texture Texture2D, pixels []Color) {
|
||||||
ctexture := texture.cptr()
|
ctexture := texture.cptr()
|
||||||
cpixels := unsafe.Pointer(&pixels[0])
|
cpixels := unsafe.Pointer(&pixels[0])
|
||||||
C.UpdateTexture(*ctexture, cpixels)
|
C.UpdateTexture(*ctexture, cpixels)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue