Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #ifndef INPUTMANAGER_H
  2. #define INPUTMANAGER_H
  3.  
  4. #include <SFML/Graphics/RenderWindow.hpp>
  5. #include <SFML/Window/Input.hpp>
  6.  
  7. class InputManager
  8. {
  9.     public:
  10.         InputManager(sf::RenderWindow&);
  11.         void Update();
  12.         bool IsKeyDown(sf::Key::Code);
  13.         bool IsKeyUp(sf::Key::Code);
  14.         bool IsKeyReleased(sf::Key::Code);
  15.         bool IsButtonDown(sf::Mouse::Button);
  16.         bool IsButtonUp(sf::Mouse::Button);
  17.         bool IsButtonReleased(sf::Mouse::Button);
  18.         int MouseX();
  19.         int MouseY();
  20.     private:
  21.         const sf::Input& m_mainInput;
  22.         bool m_pressedKeys[sf::Key::Count];
  23.         bool m_pressedButtons[sf::Mouse::ButtonCount];
  24. };
  25.  
  26. #endif // INPUTMANAGER_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement