SDL SPOOKY PLATFORMER ENGINE  0.2.0
An implementation of a platformer using sdl, implemented using an entity component system and efficient collision management.
InputManager.hpp
Go to the documentation of this file.
1 #ifndef INPUTMANAGER_HPP
2 #define INPUTMANAGER_HPP
3 
4 #include <map>
5 
6 enum Input {
7  Left = 0,
9  Jump,
13 };
14 
18 class InputManager {
19 public:
23  ~InputManager();
24 
28  static InputManager& getInstance();
29 
33  void init();
37  void initInput(unsigned int id);
41  void setInputDown(unsigned int id, bool inputDown);
45  bool getInputDown(unsigned int id);
49  void shutdown();
50 
51 private:
52  InputManager();
53 
54  bool initialized{false};
55  static InputManager* instance;
56  std::map<unsigned int, bool> inputsDown;
57 };
58 #endif
void shutdown()
Definition: InputManager.cpp:42
bool getInputDown(unsigned int id)
Definition: InputManager.cpp:35
void setInputDown(unsigned int id, bool inputDown)
Definition: InputManager.cpp:29
void initInput(unsigned int id)
Definition: InputManager.cpp:25
void init()
Definition: InputManager.cpp:20
static InputManager & getInstance()
Definition: InputManager.cpp:15
~InputManager()
Definition: InputManager.cpp:6
Definition: InputManager.hpp:18
Definition: InputManager.hpp:12
Definition: InputManager.hpp:11
Definition: InputManager.hpp:10
Definition: InputManager.hpp:9
Definition: InputManager.hpp:8
Definition: InputManager.hpp:7
Input
Definition: InputManager.hpp:6