mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
graphics: Check error at the end of the frame
The error should be raised as soon as possible.
This commit is contained in:
parent
6c8b7f8e9c
commit
aed0bf4a37
@ -82,10 +82,6 @@ func (c *graphicsContext) initializeIfNeeded() error {
|
||||
}
|
||||
|
||||
func (c *graphicsContext) Update(afterFrameUpdate func()) error {
|
||||
if err := shareable.Error(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
updateCount := clock.Update()
|
||||
|
||||
if err := c.initializeIfNeeded(); err != nil {
|
||||
@ -130,6 +126,10 @@ func (c *graphicsContext) Update(afterFrameUpdate func()) error {
|
||||
_ = c.screen.DrawImage(c.offscreen, op)
|
||||
|
||||
shareable.ResolveStaleImages()
|
||||
|
||||
if err := shareable.Error(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user