Open Rojetto opened 1 year ago
I think what's happening here is that the OS is delaying the touch events to see whether they match a system gesture, and only passes them to the application if they don't. I think there's a way to disable system gestures, but I'm not sure.
https://github.com/libsdl-org/SDL/pull/9445 may help by providing this information directly to your app, without you having to reimplement gestures yourself.
We are scoping work for the SDL 3.2.0 release, so please let us know if this is a showstopper for you.
I'm using
SDL_FingerTouchEvent
s to implement two-finger panning and pinch-zooming for macOS trackpads (using a Macbook Air M2). This works in principle, but at the beginning of every two finger gesture, there is some visual hitching. Afterwards, all motions look smooth.I can see in my profiler that I'm not dropping frames. Instead, the SDL events seem to get "clumped" up at the beginning of the motion, then come all in one burst 100-200 ms later, which changes the on-screen object's position in one big step, leading to the visual hitch.
I've noticed the same thing happening with
SDL_MultiGestureEvent
s. Maybe there is some kind of touch threshold value I can disable?