Advertisement
DSHFJGHLKG

Untitled

Dec 15th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #pragma once
  2. #include "InputListener.h"
  3. #include <unordered_set>
  4. #include "Point.h"
  5.  
  6. class InputSystem
  7. {
  8. public:
  9.     InputSystem();
  10.     ~InputSystem();
  11.  
  12.     void update();
  13.     void addListener(InputListener* listener);
  14.     void removeListener(InputListener* listener);
  15.  
  16. public:
  17.     static InputSystem* get();
  18.  
  19. private:   
  20.     std::unordered_set<InputListener*> m_set_listeners;
  21.     unsigned char m_keys_state[256] = {};
  22.     unsigned char m_old_keys_state[256] = {};
  23.     Point m_old_mouse_pos;
  24.     bool m_first_time = true;
  25. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement