Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a touch display. As input I can receive the coordinates and how many touch points are in use, basically I just get an X,Y couple for every touch event/activated point at a customizable rate.

I need to start from this and build my own callback system to achieve something like Object.onUp().doSomething() meaning that I would like to abstract just the detection of some particular movements and not having to deal with raw data: what algorithms can be useful in this case? What statements? Is there some C++ library that I can dissect to get some useful info?

Would you suggest the use of an heuristic algorithm?

share|improve this question

closed as off topic by Jonathan Hobbs, Josh Petrie, Byte56, Trevor Powell, Nate Nov 9 '12 at 18:42

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Since this deals more directly with coding in general, you may want to ask on Stack Overflow instead. However, they prefer it if you have some code/research done beforehand. –  Orin MacGregor Oct 10 '12 at 20:24
add comment

1 Answer 1

Touch screens are not inherently more difficult than mice or keyboards. Heuristics are not required in any sense. It's just a matter of comparing data from one tick to the next.

Simply maintain a structure to hold the previous raw data. Each frame, store the last frame's data into it, and then fetch new data. An up event is the former presence of a touch datum while the current frame lacks it. Motion is simply the current touch position minus the first.

Using those determinations, you can build up higher order functions like detection of gestures, multitouch patterns, etc.

Don't overthink it just because it's a touch screen. :)

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.