25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

60 satır
1.4 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the Do What The Fuck You Want To
  7. // Public License, Version 2, as published by Sam Hocevar. See
  8. // http://sam.zoy.org/projects/COPYING.WTFPL for more details.
  9. //
  10. //
  11. // The Input static class
  12. // ----------------------
  13. //
  14. #if !defined __LOL_INPUT_INPUT_H__
  15. #define __LOL_INPUT_INPUT_H__
  16. #include "lol/math/vector.h"
  17. #include "input/stick.h"
  18. namespace lol
  19. {
  20. class WorldEntity;
  21. class Input
  22. {
  23. public:
  24. /* These methods are general queries */
  25. static ivec2 GetMousePos();
  26. static ivec3 GetMouseButtons();
  27. //BH : Added this, is a v0.1 Alpha version.
  28. static int GetButtonState(int button);
  29. /* Entities can subscribe to events */
  30. static void TrackMouse(WorldEntity *e);
  31. static void UntrackMouse(WorldEntity *e);
  32. /* These methods are called by the underlying input listeners */
  33. static void SetMousePos(ivec2 coord);
  34. static void SetMouseButton(int index);
  35. static void UnsetMouseButton(int index);
  36. /*
  37. * Joystick handling
  38. */
  39. static Stick *CreateStick();
  40. static void DestroyStick(Stick *stick);
  41. static Stick *TrackStick(int desired);
  42. static void UntrackStick(Stick *stick);
  43. };
  44. } /* namespace lol */
  45. #endif // __LOL_INPUT_INPUT_H__