fallout2-ce/src/touch.h

39 lines
645 B
C
Raw Normal View History

2023-05-09 08:36:20 -07:00
#ifndef FALLOUT_TOUCH_H_
#define FALLOUT_TOUCH_H_
#include <SDL.h>
namespace fallout {
enum GestureType {
kUnrecognized,
kTap,
kLongPress,
kPan,
};
enum GestureState {
kPossible,
kBegan,
kChanged,
kEnded,
};
struct Gesture {
GestureType type;
GestureState state;
int numberOfTouches;
int x;
int y;
};
void touch_handle_start(SDL_TouchFingerEvent* event);
void touch_handle_move(SDL_TouchFingerEvent* event);
void touch_handle_end(SDL_TouchFingerEvent* event);
void touch_process_gesture();
bool touch_get_gesture(Gesture* gesture);
} // namespace fallout
#endif /* FALLOUT_TOUCH_H_ */