mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 03:02:49 +01:00
uidriver/glfw: Bug fix: Show the window at last on initialization
This commit is contained in:
parent
e00a190f22
commit
3e89e7e561
@ -671,8 +671,6 @@ func (u *UserInterface) createWindow() error {
|
|||||||
u.reqHeight = h
|
u.reqHeight = h
|
||||||
})
|
})
|
||||||
|
|
||||||
u.window.Show()
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -766,6 +764,7 @@ func (u *UserInterface) run(width, height int, scale float64, title string, cont
|
|||||||
x, y = adjustWindowPosition(x, y)
|
x, y = adjustWindowPosition(x, y)
|
||||||
}
|
}
|
||||||
u.window.SetPos(x, y)
|
u.window.SetPos(x, y)
|
||||||
|
u.window.Show()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
@ -1018,13 +1017,13 @@ func (u *UserInterface) setScreenSize(width, height int, scale float64, fullscre
|
|||||||
// TODO: This should return an error.
|
// TODO: This should return an error.
|
||||||
panic(fmt.Sprintf("glfw: failed to recreate window: %v", err))
|
panic(fmt.Sprintf("glfw: failed to recreate window: %v", err))
|
||||||
}
|
}
|
||||||
|
u.window.Show()
|
||||||
windowRecreated = true
|
windowRecreated = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
oldW, oldH := u.window.GetSize()
|
oldW, oldH := u.window.GetSize()
|
||||||
newW, newH := u.deviceDependentWindowSize()
|
if newW, newH := u.deviceDependentWindowSize(); oldW != newW || oldH != newH {
|
||||||
if oldW != newW || oldH != newH {
|
|
||||||
ch := make(chan struct{})
|
ch := make(chan struct{})
|
||||||
u.window.SetFramebufferSizeCallback(func(_ *glfw.Window, _, _ int) {
|
u.window.SetFramebufferSizeCallback(func(_ *glfw.Window, _, _ int) {
|
||||||
u.window.SetFramebufferSizeCallback(nil)
|
u.window.SetFramebufferSizeCallback(nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user