-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMouse.h
48 lines (44 loc) · 1.06 KB
/
CMouse.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef CMOUSE_H
#define CMOUSE_H
#include "CMouseState.h"
namespace game_framework {
/////////////////////////////////////////////////////////////////////////////
// 這個singleton class提供滑鼠介面,需知道各個事件的使用時機
//
/////////////////////////////////////////////////////////////////////////////
class CMouse{
public:
//取得滑鼠實體
static CMouse* GetMouse();
//釋放滑鼠實體
void Dispose();
//滑鼠事件
void OnLeftDown(const CPoint&);
void OnLeftUp(const CPoint&);
void OnLeftClick(const CPoint&);
void OnRightDown(const CPoint&);
void OnRightUp(const CPoint&);
void OnRightClick(const CPoint&);
void OnMouseMove(const CPoint&);
//滑鼠狀態
CPoint& LeftDownPoint();
CPoint& RightDownPoint();
CPoint& Point();
bool& LeftIsDown();
bool& RightIsDown();
bool& MoveAfterMouseDown();
CMouseState& MouseState();
private:
static CMouse* mouse;
CMouse();
~CMouse();
bool leftIsDown;
bool rightIsDown;
bool moveAfterMouseDown;
CPoint point;
CPoint leftDownPoint;
CPoint rightDownPoint;
CMouseState mouseState;
};
}
#endif