[SDL2] No renderer vsync on macOS Mojave?


I can confirm that if you compile an SDL2.0.9 program with XCode 9 (on High SIerra) instead of XCode 10 (on Mojave), renderer vsync will work properly in macOS Mojave!


This commit should make vsync work on Mojave, compiled with Xcode 10…

…as an added bonus, it should give you adaptive vsync (it does vsync if you beat the swap interval, but swap immediately if you were late) on the mac, which we never had before. That’s enabled by calling SDL_GL_SetSwapInterval(-1). Linux and Windows already have adaptive vsync, if it’s supported at the driver level, but this patch manages it inside SDL with a little help from CVDisplayLink.

Please test this (on both Xcode 9 and 10, Mojave or not)!



I don’t have Xcode 9 on my machine, but with Xcode 10 on Mojave this works. Don’t have an adaptive sync monitor, so I can’t test that part.