PointerState.cpp 393 B

123456789101112131415161718192021
  1. #include "PointerState.h"
  2. #include "Actor.h"
  3. namespace oxygine
  4. {
  5. PointerState::PointerState(): _index(1)
  6. {
  7. init(_index);
  8. }
  9. void PointerState::init(pointer_index index)
  10. {
  11. _index = index;
  12. _pressed = 0;
  13. _position.setZero();
  14. }
  15. bool PointerState::isPressed(MouseButton mb) const
  16. {
  17. return (_pressed & (1 << mb)) != 0;
  18. }
  19. }