I am porting my apps to SDL3. I am using SDL_gesture.h
from GitHub - libsdl-org/SDL_gesture: SDL2's gesture API split out into a single-header library.. All the events I am receiving from the library have timestamp == 0
. What am I doing wrong?
I’m calling GestureInit() right after SDL_Init().
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS)) {
fprintf(stderr, "%s: SDL video initialization failed: %s\n",
theApp->name(), SDL_GetError());
return 1;
}
Gesture_Init();
In the event handler
Gesture_MultiGestureEvent& mgesture = *(Gesture_MultiGestureEvent *)event;
#if LOG_GESTURE_EVENTS
SDL_Log("MG: x = %f, y = %f, dAng = %f (%f), dR = %f, numFingers = %i, timestamp = %i",
mgesture.x,
mgesture.y,
mgesture.dTheta * 180.0 / M_PI,
mgesture.dTheta,
mgesture.dDist,
mgesture.numFingers,
mgesture.timestamp);
#endif
The code in SDL_gesture.h
that generates the event sets timestamp = 0
. Presumably it expects SDL_PushEvent((SDL_Event*)&mgesture);
to add the timestamp. Why would it not be adding a timestamp?