载入中...
搜索中...
未找到
Touch.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Module.h"
4
5#include <vector>
6#include <limits>
7
8namespace eve::touch
9{
10
11class Touch : public Module
12{
13public:
15 struct TouchInfo
16 {
17 int64_t id; // Identifier. Only unique for the duration of the touch-press.
18 double x; // Position in pixels along the x-axis.
19 double y; // Position in pixels along the y-axis.
20 double dx; // Amount in pixels moved along the x-axis.
21 double dy; // Amount in pixels moved along the y-axis.
22 double pressure;
23 };
24
25 virtual ~Touch() {}
26
30 virtual const std::vector<TouchInfo> &getTouches() const = 0;
31
35 virtual const TouchInfo &getTouch(int64_t id) const = 0;
36
37 int getTouchCount() const { return int(getTouches().size()); }
38 double getTouchX(int index) const;
39 double getTouchY(int index) const;
40
41}; // Touch
42
43} // eve::touch
44
45
virtual ~Touch()
Definition Touch.h:25
double getTouchY(int index) const
Definition Touch.cpp:16
double getTouchX(int index) const
Definition Touch.cpp:9
virtual const std::vector< TouchInfo > & getTouches() const =0
Gets all currently active touches.
virtual const TouchInfo & getTouch(int64_t id) const =0
Gets a specific touch, using its ID.
int getTouchCount() const
Definition Touch.h:37