SDXFrameWork 0.09 SDXFrameWork

- Main Page
- Related Pages
- Classes

All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Mouse.h
1 #pragma once//☀SDL
2 #include <Multimedia/SDX.h>
3 #include <Multimedia/Key.h>
4 #include <Framework/Shape.h>
5 #include <Multimedia/InputEnum.h>
6 #include <Multimedia/Window.h>
7
8 namespace SDX
9 {
12 class Mouse
13 {
14 friend class Input;
15 private:
16 Mouse(const Mouse &mouse){};
17 Mouse operator =(const Mouse &mouse) = delete;
18 int xBuffer;
19 int yBuffer;
20 public:
21 Mouse()
22 {
23 Reset();
24 }
25
26 int x;
27 int y;
28
29 int moveX;
30 int moveY;
31
32 int Whell;
33
34 bool press[8];
35
36 Key Left;
37 Key Right;
38 Key Middle;
39
40 Key Button4;
41 Key Button5;
42 Key Button6;
43 Key Button7;
44 Key Button8;
45
46 int maxButton;
47
49 void Reset()
50 {
51 x = 0;
52 y = 0;
53 moveX = 0;
54 moveY = 0;
55 Left.Reset();
56 Right.Reset();
57 Middle.Reset();
58 Button4.Reset();
59 Button5.Reset();
60 Button6.Reset();
61 Button7.Reset();
62 Button8.Reset();
63 Whell = 0;
64 }
65
67 void Update()
68 {
69 Left.Update( press[(int)MouseCode::Left] );
70 Right.Update( press[(int)MouseCode::Right] );
71 Middle.Update( press[(int)MouseCode::Middle] );
72
73 Button4.Update( press[(int)MouseCode::_4] );
74 Button5.Update( press[(int)MouseCode::_5] );
75 Button6.Update( press[(int)MouseCode::_6] );
76 Button7.Update( press[(int)MouseCode::_7] );
77 Button8.Update( press[(int)MouseCode::_8] );
78
79 moveX = xBuffer - x;
80 moveY = yBuffer - y;
81
82 x = xBuffer;
83 y = yBuffer;
84 }
85
87 bool SetVisible(bool 表示フラグ)
88 {
89 return false;
90 }
91
93 bool SetPoint( int 移動先X , int 移動先Y )
94 {
95 SDL_WarpMouseInWindow(Window::Single().handle, x, y);
96 return true;
97 }
98 };
99 }
SDX::Mouse
マウスの状態を表すクラス.
Definition: Mouse.h:12
SDX::Key::Reset
void Reset()
キーのリセット.
Definition: Key.h:17
SDX::Key::Update
void Update(int 押下フラグ)
押下状態の更新.
Definition: Key.h:26
SDX::Mouse::Reset
void Reset()
状態のリセット.
Definition: Mouse.h:49
SDX::Mouse::SetVisible
bool SetVisible(bool 表示フラグ)
カーソルの表示設定[未実装].
Definition: Mouse.h:87
SDX::Input
キーやマウスによる入力をまとめて管理するクラス.
Definition: Input.h:13
SDX::Mouse::SetPoint
bool SetPoint(int 移動先X, int 移動先Y)
カーソル位置を移動.
Definition: Mouse.h:93
SDX::Mouse::Update
void Update()
状態の更新.
Definition: Mouse.h:67
SDX::Key
各ボタンとキーを表すクラス.
Definition: Key.h:8