Skylicht Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
CTouchManager.h
1
/*
2
!@
3
MIT License
4
5
Copyright (c) 2019 Skylicht Technology CO., LTD
6
7
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
8
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
9
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
10
subject to the following conditions:
11
12
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
13
14
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
20
This file is part of the "Skylicht Engine".
21
https://github.com/skylicht-lab/skylicht-engine
22
!#
23
*/
24
25
#pragma once
26
27
#include "Utils/CSingleton.h"
28
#include "CTouchIdentify.h"
29
30
namespace
Skylicht
31
{
32
class
SKYLICHT_API CTouchManager
33
{
34
public
:
35
DECLARE_SINGLETON
(CTouchManager)
36
37
public
:
38
enum
ETouchEvent
39
{
40
TouchNone = 0,
41
TouchDown,
42
TouchMove,
43
TouchUp,
44
};
45
46
struct
STouchStatus
47
{
48
ETouchEvent touchEvent;
49
int
x;
50
int
y;
51
long
touchID;
52
};
53
54
protected
:
55
core::array<STouchStatus> m_touchQueue;
56
57
STouchStatus
m_touch[MAX_MULTITOUCH];
58
CTouchIdentify
m_touchIdentify;
59
60
public
:
61
CTouchManager();
62
virtual
~CTouchManager();
63
64
void
resetTouch();
65
66
void
update();
67
68
void
touchEvent(ETouchEvent touchEvent,
int
x,
int
y,
long
id
);
69
70
inline
CTouchIdentify
* getTouchIdentify()
71
{
72
return
&m_touchIdentify;
73
}
74
75
inline
void
setTouchIdentify(
int
touchID, CTouchIdentify::ETouchIdentify identify,
void
* data = NULL)
76
{
77
m_touchIdentify.setTouchIdentify(touchID, identify, data);
78
}
79
80
inline
CTouchIdentify::ETouchIdentify getTouchIdentify(
int
touchID)
81
{
82
return
m_touchIdentify.getTouchIdentify(touchID);
83
}
84
85
void
updateTouch(ETouchEvent touchEvent,
int
x,
int
y,
long
id
);
86
87
void
updateEvent();
88
89
};
90
91
}
Skylicht::CTouchIdentify
Definition
CTouchIdentify.h:32
DECLARE_SINGLETON
#define DECLARE_SINGLETON(className)
Declare the standard singleton accessors for a class.
Definition
CSingleton.h:36
Skylicht
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition
AudioDebugLog.h:29
Skylicht::CTouchManager::STouchStatus
Definition
CTouchManager.h:47
Generated by
1.17.0