HatchitGame
ht_glfwmouse.h
1 
15 #pragma once
16 
17 #include <ht_platform.h>
18 #include <ht_mouse.h>
19 #include <ht_types.h>
20 #include <GLFW/glfw3.h>
21 
22 namespace Hatchit
23 {
24  namespace Game
25  {
27  {
28  uint8_t clicks;
29  uint8_t state;
30  };
31 
32  class HT_API GLFWMouse : public IMouse
33  {
34  static const int NUM_BUTTONS = 3;
35  public:
36  GLFWMouse();
37 
38  int VMouseX() override;
39  int VMouseY() override;
40  int VPreviousMouseX() override;
41  int VPreviousMouseY() override;
42  int VMouseWheelX() override;
43  int VMouseWheelY() override;
44  int VDeltaX(int val) override;
45  int VDeltaY(int val) override;
46 
47  bool VButtonRelease(MouseButton button) override;
48  bool VButtonPress(MouseButton button) override;
49  bool VSingleButtonPress(MouseButton button) override;
50 
51  void VUpdate() override;
52 
53 
54  void RegisterMouseMove(int x, int y);
55  void RegisterMouseButtonEvent(int e, int action);
56  void RegisterMouseWheelEvent(int xoffset, int yoffset);
57 
58  private:
59  int m_x;
60  int m_y;
61  int m_prevX;
62  int m_prevY;
63  int m_wx;
64  int m_wy;
65  int m_prevWX;
66  int m_prevWY;
67  GLFWMouseState m_current[NUM_BUTTONS];
68  GLFWMouseState m_previous[NUM_BUTTONS];
69  };
70  }
71 }
Definition: ht_glfwmouse.h:26
Definition: ht_glfwmouse.h:32
Hatchit Engine Copyright(c) 2015-2016 Third-Degree.
Definition: ht_glfwkeyboard.h:21
Definition: ht_mouse.h:30