InputDummy.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Copyright (C) 2009-present, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #include <AnKi/Window/Input.h>
  6. #include <AnKi/Window/NativeWindow.h>
  7. namespace anki {
  8. template<>
  9. template<>
  10. Input& MakeSingletonPtr<Input>::allocateSingleton<>()
  11. {
  12. ANKI_ASSERT(m_global == nullptr);
  13. m_global = new Input;
  14. #if ANKI_ASSERTIONS_ENABLED
  15. ++g_singletonsAllocated;
  16. #endif
  17. return *m_global;
  18. }
  19. template<>
  20. void MakeSingletonPtr<Input>::freeSingleton()
  21. {
  22. if(m_global)
  23. {
  24. delete static_cast<Input*>(m_global);
  25. m_global = nullptr;
  26. #if ANKI_ASSERTIONS_ENABLED
  27. --g_singletonsAllocated;
  28. #endif
  29. }
  30. }
  31. Error Input::init()
  32. {
  33. return Error::kNone;
  34. }
  35. Error Input::handleEvents()
  36. {
  37. if(m_lockCurs)
  38. {
  39. moveMouseNdc(Vec2(0.0f));
  40. }
  41. return Error::kNone;
  42. }
  43. void Input::moveMouseNdc(const Vec2& posNdc)
  44. {
  45. m_mousePosNdc = posNdc;
  46. }
  47. void Input::hideCursor([[maybe_unused]] Bool hide)
  48. {
  49. // Nothing
  50. }
  51. Bool Input::hasTouchDevice() const
  52. {
  53. return false;
  54. }
  55. void Input::setMouseCursor([[maybe_unused]] MouseCursor cursor)
  56. {
  57. // Nothing
  58. }
  59. } // end namespace anki