-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputProcessor.h
More file actions
45 lines (35 loc) · 1.16 KB
/
InputProcessor.h
File metadata and controls
45 lines (35 loc) · 1.16 KB
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
#ifndef _INPUTPROCESSOR_H_
#define _INPUTPROCESSOR_H_
#include "lib/OIS/OISKeyboard.h"
#include "lib/OIS/OISMouse.h"
#include "lib/OIS/OISJoystick.h"
#include "lib/OIS/OISInputManager.h"
#include "Vector2D.h"
#include <vector>
#include <algorithm>
class CInputProcessor : public OIS::KeyListener, public OIS::MouseListener
{
public:
CInputProcessor(OIS::ParamList pl);
virtual ~CInputProcessor();
friend class CEventProcessor;
void processInput();
inline vector2D mouseCoords(){return _mouseCoords;}
inline bool quitGame(){return _quitGame;}
private:
OIS::InputManager * _inputManager;
OIS::Keyboard * _keyboard;
OIS::Mouse * _mouse;
std::vector<OIS::KeyCode> _keyBuffer;
std::vector<OIS::KeyCode> _keyReleasedBuffer;
std::vector<OIS::MouseButtonID> _mouseButtonBuffer;
std::vector<OIS::MouseButtonID> _mouseReleasedBuffer;
vector2D _mouseCoords;
static bool _quitGame;
bool keyPressed(const OIS::KeyEvent & arg);
bool keyReleased(const OIS::KeyEvent & arg);
bool mouseMoved( const OIS::MouseEvent &arg );
bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
bool mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
};
#endif