internal/ui: set SwapInterval(0) when resizing the window

This mitigates flickering at least on macOS with OpenGL.

Updates #2144
This commit is contained in:
Hajime Hoshi 2022-10-29 17:47:31 +09:00
parent ac6843639d
commit ac08ebe080

View File

@ -773,7 +773,13 @@ func (u *userInterfaceImpl) registerWindowSetSizeCallback() {
}
if u.graphicsDriver.IsGL() {
glfw.SwapInterval(0)
u.swapBuffers()
if u.fpsMode == FPSModeVsyncOn {
glfw.SwapInterval(1)
} else {
glfw.SwapInterval(0)
}
}
u.forceToRefreshIfNeeded()