mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
graphics: Bug fix: restoring needs to be done after main logic execution (#357)
This commit is contained in:
parent
5a4a82ab50
commit
cbc08d9c16
@ -143,11 +143,6 @@ func (c *graphicsContext) UpdateAndDraw(context *opengl.Context, updateCount int
|
||||
if err := c.initializeIfNeeded(context); err != nil {
|
||||
return err
|
||||
}
|
||||
// TODO: Is it OK to restore images here? The images can be in 'stale' state after c.f().
|
||||
// (#357)
|
||||
if err := restorable.ResolveStalePixels(context); err != nil {
|
||||
return err
|
||||
}
|
||||
for i := 0; i < updateCount; i++ {
|
||||
restorable.ClearVolatileImages()
|
||||
setRunningSlowly(i < updateCount-1)
|
||||
@ -161,6 +156,10 @@ func (c *graphicsContext) UpdateAndDraw(context *opengl.Context, updateCount int
|
||||
if err := c.drawToDefaultRenderTarget(context); err != nil {
|
||||
return err
|
||||
}
|
||||
// TODO: Add tests to check if this behavior is correct (#357)
|
||||
if err := restorable.ResolveStalePixels(context); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user