mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
uidriver/glfw: Bug fix: Need to call updateVsync after setWindowSize
Fixes #1363
This commit is contained in:
parent
3c71eba446
commit
9890dc51da
@ -831,6 +831,17 @@ func (u *UserInterface) update() error {
|
|||||||
u.setInitFullscreen(false)
|
u.setInitFullscreen(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Initialize vsync after SetMonitor is called. See the comment in updateVsync.
|
||||||
|
// Calling this inside setWindowSize didn't work (#1363).
|
||||||
|
_ = u.t.Call(func() error {
|
||||||
|
if !u.vsyncInited {
|
||||||
|
u.vsync = u.isInitVsyncEnabled()
|
||||||
|
u.updateVsync()
|
||||||
|
u.vsyncInited = true
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
|
||||||
// This call is needed for initialization.
|
// This call is needed for initialization.
|
||||||
u.updateSize()
|
u.updateSize()
|
||||||
|
|
||||||
@ -1046,13 +1057,6 @@ func (u *UserInterface) setWindowSize(width, height int, fullscreen bool) {
|
|||||||
u.windowWidth = width
|
u.windowWidth = width
|
||||||
u.windowHeight = height
|
u.windowHeight = height
|
||||||
|
|
||||||
if !u.vsyncInited {
|
|
||||||
// Initialize vsync after SetMonitor is called. See the comment in updateVsync.
|
|
||||||
u.vsync = u.isInitVsyncEnabled()
|
|
||||||
u.updateVsync()
|
|
||||||
u.vsyncInited = true
|
|
||||||
}
|
|
||||||
|
|
||||||
u.toChangeSize = true
|
u.toChangeSize = true
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user