mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
Bug fix: SetFramebufferSizeCallback can be called immediately
This commit is contained in:
parent
48f639db02
commit
bf027fef33
8
ui.go
8
ui.go
@ -72,16 +72,16 @@ func startUI(width, height, scale int, title string) error {
|
||||
x := (videoMode.Width - width*scale) / 2
|
||||
y := (videoMode.Height - height*scale) / 3
|
||||
|
||||
ch := make(chan struct{})
|
||||
window := currentUI.window
|
||||
window.SetFramebufferSizeCallback(func(w *glfw.Window, width, height int) {
|
||||
close(ch)
|
||||
})
|
||||
window.SetSize(width*scale, height*scale)
|
||||
window.SetTitle(title)
|
||||
window.SetPosition(x, y)
|
||||
window.Show()
|
||||
|
||||
ch := make(chan struct{})
|
||||
window.SetFramebufferSizeCallback(func(w *glfw.Window, width, height int) {
|
||||
close(ch)
|
||||
})
|
||||
for {
|
||||
done := false
|
||||
glfw.PollEvents()
|
||||
|
Loading…
Reference in New Issue
Block a user