mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
uidriver/glfw: Bug fix: Need to call updateVsync after setWindowSize
Fixes #1363
This commit is contained in:
parent
9a3a72e0ec
commit
1ead096f67
@ -811,6 +811,17 @@ func (u *UserInterface) update(context driver.UIContext) error {
|
||||
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.
|
||||
u.updateSize(context)
|
||||
|
||||
@ -1026,13 +1037,6 @@ func (u *UserInterface) setWindowSize(width, height int, fullscreen bool) {
|
||||
u.windowWidth = width
|
||||
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
|
||||
return nil
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user