mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
ui: Allow SetFullscreen without Run
This commit is contained in:
parent
697c23a807
commit
c94c994bd1
@ -154,17 +154,15 @@ func SetScreenScale(scale float64) bool {
|
||||
return r
|
||||
}
|
||||
|
||||
func SetFullscreen(fullscreen bool) bool {
|
||||
func SetFullscreen(fullscreen bool) {
|
||||
// This can be called before Run: change the state asyncly.
|
||||
go func() {
|
||||
_ = currentUI.runOnMainThread(func() error {
|
||||
u := currentUI
|
||||
if !u.isRunning() {
|
||||
panic("ui: Run is not called yet")
|
||||
}
|
||||
r := false
|
||||
_ = u.runOnMainThread(func() error {
|
||||
r = u.setScreenSize(u.width, u.height, u.scale, fullscreen)
|
||||
u.setScreenSize(u.width, u.height, u.scale, fullscreen)
|
||||
return nil
|
||||
})
|
||||
return r
|
||||
}()
|
||||
}
|
||||
|
||||
func ScreenScale() float64 {
|
||||
|
Loading…
Reference in New Issue
Block a user