23#ifndef EVENGINE_MACOSX
25void normalizedToDPICoords(
double *
x,
double *
y) {
26 double w = 1.0,
h = 1.0;
27 if (
auto *win = eve::ModuleManager::getInstance<eve::window::Window>(
"Window")) {
38 bool observePlatformEvent(
const void *nativeEvent)
override {
39 const auto &e = *
static_cast<const SDL_Event *
>(nativeEvent);
40 if (e.type != SDL_FINGERDOWN && e.type != SDL_FINGERUP && e.type != SDL_FINGERMOTION)
43 auto *touchMod =
dynamic_cast<Touch *
>(
44 eve::ModuleManager::getInstance<eve::touch::Touch>(
"Touch"));
45 if (!touchMod)
return false;
48 info.
id =
static_cast<int64_t
>(e.tfinger.fingerId);
51 info.dx = e.tfinger.dx;
52 info.dy = e.tfinger.dy;
53 info.pressure = e.tfinger.pressure;
54#ifndef EVENGINE_MACOSX
55 normalizedToDPICoords(&info.x, &info.y);
56 normalizedToDPICoords(&info.dx, &info.dy);
58 touchMod->onEvent(e.type, info);
66 static TouchEventSink sink;