mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +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 {
|
func (i *Image) ReplacePixels(p []uint8) error {
|
||||||
|
pixels := make([]uint8, len(p))
|
||||||
|
copy(pixels, p)
|
||||||
c := &replacePixelsCommand{
|
c := &replacePixelsCommand{
|
||||||
dst: i,
|
dst: i,
|
||||||
pixels: p,
|
pixels: pixels,
|
||||||
}
|
}
|
||||||
theCommandQueue.Enqueue(c)
|
theCommandQueue.Enqueue(c)
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user