void HelloMultitouchApp::update() { GestureWorks::Instance()->ProcessFrame(); std::vector point_events = GestureWorks::Instance()->ConsumePointEvents(); for (std::vector::iterator event_it = point_events.begin(); event_it != point_events.end(); event_it++) { std::pair pair = normScreenToWindowPx(event_it->position.x, event_it->position.y); switch (event_it->status) { case gwc::TOUCHADDED: case gwc::TOUCHUPDATE: //If the point is being added, this will place it in our point map; //the same line of code will update the point's position if it's //already present, so we can use this command to handle new points //as well as point updates active_points[event_it->point_id] = gwc::Point(pair.first, pair.second); break; case gwc::TOUCHREMOVED: //Remove the point from the map active_points.erase(event_it->point_id); break; } } }