更新 'framebuffer.go'
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Jay 2020-07-08 15:00:17 +00:00
parent b9a231b816
commit 4dcd1701ea

View File

@ -122,6 +122,8 @@ func (f *Framebuffer) SetPixel(x int, y int, r uint32, g uint32, b uint32, a uin
location := (x+f.Xoffset)*(f.BitsPerPixel/8) + (y+f.Yoffset)*f.LineLength location := (x+f.Xoffset)*(f.BitsPerPixel/8) + (y+f.Yoffset)*f.LineLength
fmt.Println("location :: ", location, " / data len:: ", len(f.Data))
f.Data[location+3] = byte(a & 0xff) f.Data[location+3] = byte(a & 0xff)
f.Data[location+2] = byte(r & 0xff) f.Data[location+2] = byte(r & 0xff)
f.Data[location+1] = byte(g & 0xff) f.Data[location+1] = byte(g & 0xff)