mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
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:
parent
ac6843639d
commit
ac08ebe080
@ -773,7 +773,13 @@ func (u *userInterfaceImpl) registerWindowSetSizeCallback() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if u.graphicsDriver.IsGL() {
|
if u.graphicsDriver.IsGL() {
|
||||||
|
glfw.SwapInterval(0)
|
||||||
u.swapBuffers()
|
u.swapBuffers()
|
||||||
|
if u.fpsMode == FPSModeVsyncOn {
|
||||||
|
glfw.SwapInterval(1)
|
||||||
|
} else {
|
||||||
|
glfw.SwapInterval(0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u.forceToRefreshIfNeeded()
|
u.forceToRefreshIfNeeded()
|
||||||
|
Loading…
Reference in New Issue
Block a user