-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMouse.h
More file actions
50 lines (37 loc) · 910 Bytes
/
Copy pathMouse.h
File metadata and controls
50 lines (37 loc) · 910 Bytes
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
49
50
/********************************************************/
/** \file Mouse.h
\brief Contains the CMouse class
\author José Mª Arnau
\date 11/09/2006
*********************************************************/
#ifndef __MOUSE_INCLUDED__
#define __MOUSE_INCLUDED__
#include <SDL/SDL.h>
#define N_MOUSE_BUTTONS 5
/*
SDL_BUTTON_LEFT = 1
SDL_BUTTON_MIDDLE = 2
SDL_BUTTON_RIGHT = 3
SDL_BUTTON_WHEELUP = 4
SDL_BUTTON_WHEELDOWN = 5
*/
struct MouseState
{
int x,y;
bool buttons[N_MOUSE_BUTTONS+1];
};
/********************************************************/
/** \class CMouse
\brief This class controls the mouse
*********************************************************/
class CMouse
{
public:
bool ButtonDown(int button);
bool ButtonUp(int button);
void GetMovement(int &dx, int &dy);
bool Update();
private:
MouseState m_state;
};
#endif