Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Platform: handle (multi-)touch events in EmscriptenApplication.
The impossible-to-reliably-disable behavior with compatibility mouse events is quite a headache. I wish Emscripten implemented pointer events already so I could ditch this mess -- especially the array of 32 touches where all of them but one will be unchanged is stupid. For the internals unfortunately, EmscriptenMouseEvent and EmscriptenTouchEvent have no common base, so I had to give up on the current way of querying the event struct directly from event getters, as that'd be too nasty with the branching and casts. Instead the relevant fields are put directly into the events themselves. HTML5 also doesn't provide any relative pointer position. For the mouse it was rather straightforward, but for the up-to-32 touches I have to maintain an array of per-finger positions and match them by ID. Hopefully the linear lookup is fine. I'll probably use the same approach for the AndroidApplication.
- Loading branch information