ui: Bug fix: SwapInterval needs to be called after SetMonitor (#357)

This commit is contained in:
Hajime Hoshi 2017-07-01 12:41:16 +09:00
parent ba204c6d3b
commit 7d236950c2

View File

@ -80,7 +80,6 @@ func initialize() error {
origPosY: -1, origPosY: -1,
} }
u.window.MakeContextCurrent() u.window.MakeContextCurrent()
glfw.SwapInterval(1)
currentUI = u currentUI = u
return nil return nil
} }
@ -445,6 +444,10 @@ func (u *userInterface) setScreenSize(width, height int, scale float64, fullscre
// Window title might lost on macOS after coming back from fullscreen. // Window title might lost on macOS after coming back from fullscreen.
u.window.SetTitle(u.title) u.window.SetTitle(u.title)
} }
// SwapInterval is affected by the current monitor of the window.
// This needs to be called at least after SetMonitor.
// Without SwapInterval after SetMonitor, vsynch doesn't work (#357).
glfw.SwapInterval(1)
// TODO: Rename this variable? // TODO: Rename this variable?
u.sizeChanged = true u.sizeChanged = true
return true return true