mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
graphics: Remove GraphicsContext.Invalidated
This commit is contained in:
parent
3cb9d18fc4
commit
b579bd7fd0
@ -45,19 +45,10 @@ type graphicsContext struct {
|
||||
screenHeight int
|
||||
screenScale float64
|
||||
initialized bool
|
||||
invalidated bool // browser only
|
||||
offsetX float64
|
||||
offsetY float64
|
||||
}
|
||||
|
||||
func (c *graphicsContext) Invalidate() {
|
||||
// Note that this is called only on browsers so far.
|
||||
// TODO: On mobiles, this function is not called and instead IsTexture is called
|
||||
// to detect if the context is lost. This is simple but might not work on some platforms.
|
||||
// Should Invalidate be called explicitly?
|
||||
c.invalidated = true
|
||||
}
|
||||
|
||||
func (c *graphicsContext) SetSize(screenWidth, screenHeight int, screenScale float64) {
|
||||
c.screenScale = screenScale
|
||||
|
||||
@ -180,6 +171,5 @@ func (c *graphicsContext) restoreIfNeeded() error {
|
||||
if err := shareable.Restore(); err != nil {
|
||||
return err
|
||||
}
|
||||
c.invalidated = false
|
||||
return nil
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ import (
|
||||
type GraphicsContext interface {
|
||||
SetSize(width, height int, scale float64)
|
||||
Update(afterFrameUpdate func()) error
|
||||
Invalidate()
|
||||
}
|
||||
|
||||
// RegularTermination represents a regular termination.
|
||||
|
Loading…
Reference in New Issue
Block a user