CGLFWMouseInput.h 867 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #include "WallpaperEngine/Input/CMouseInput.h"
  3. #include <glm/vec2.hpp>
  4. namespace WallpaperEngine::Render::Drivers
  5. {
  6. class CX11OpenGLDriver;
  7. }
  8. namespace WallpaperEngine::Input::Drivers
  9. {
  10. /**
  11. * Handles mouse input for the background
  12. */
  13. class CGLFWMouseInput : public CMouseInput
  14. {
  15. public:
  16. explicit CGLFWMouseInput(Render::Drivers::CX11OpenGLDriver* driver);
  17. /**
  18. * Takes current mouse position and updates it
  19. */
  20. void update () override;
  21. /**
  22. * The virtual pointer's position
  23. */
  24. [[nodiscard]] glm::dvec2 position () const override;
  25. private:
  26. Render::Drivers::CX11OpenGLDriver* m_driver;
  27. /**
  28. * The current mouse position
  29. */
  30. glm::dvec2 m_mousePosition;
  31. glm::dvec2 m_reportedPosition;
  32. };
  33. }