mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 12:08:58 +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 {
|
func (c *graphicsContext) Update(afterFrameUpdate func()) error {
|
||||||
if err := shareable.Error(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
updateCount := clock.Update()
|
updateCount := clock.Update()
|
||||||
|
|
||||||
if err := c.initializeIfNeeded(); err != nil {
|
if err := c.initializeIfNeeded(); err != nil {
|
||||||
@ -130,6 +126,10 @@ func (c *graphicsContext) Update(afterFrameUpdate func()) error {
|
|||||||
_ = c.screen.DrawImage(c.offscreen, op)
|
_ = c.screen.DrawImage(c.offscreen, op)
|
||||||
|
|
||||||
shareable.ResolveStaleImages()
|
shareable.ResolveStaleImages()
|
||||||
|
|
||||||
|
if err := shareable.Error(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user