mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/ui: bug fix: EndFrame was not called when layoutGame returned 0s
This commit is contained in:
parent
b94c3fa9bb
commit
2eca476054
@ -105,6 +105,18 @@ func (c *context) updateFrameImpl(graphicsDriver graphicsdriver.Graphics, update
|
||||
return err
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if err1 := atlas.EndFrame(); err1 != nil && err == nil {
|
||||
err = err1
|
||||
return
|
||||
}
|
||||
|
||||
if err1 := atlas.SwapBuffers(graphicsDriver, swapBuffersForGL); err1 != nil && err == nil {
|
||||
err = err1
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
||||
// Flush deferred functions, like reading pixels from GPU.
|
||||
if err := c.flushDeferredFuncs(ui); err != nil {
|
||||
return err
|
||||
@ -158,14 +170,6 @@ func (c *context) updateFrameImpl(graphicsDriver graphicsdriver.Graphics, update
|
||||
return err
|
||||
}
|
||||
|
||||
if err := atlas.EndFrame(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := atlas.SwapBuffers(graphicsDriver, swapBuffersForGL); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user