mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
graphics: Bug fix: Pixels should be copied to store it as a command
This commit is contained in:
parent
612d3b07b0
commit
7b32d7a206
@ -116,9 +116,11 @@ func (i *Image) Pixels(context *opengl.Context) ([]uint8, error) {
|
||||
}
|
||||
|
||||
func (i *Image) ReplacePixels(p []uint8) error {
|
||||
pixels := make([]uint8, len(p))
|
||||
copy(pixels, p)
|
||||
c := &replacePixelsCommand{
|
||||
dst: i,
|
||||
pixels: p,
|
||||
pixels: pixels,
|
||||
}
|
||||
theCommandQueue.Enqueue(c)
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user