Midnight Graphics
Create Fast and Simple Graphics in C++
Event.hpp
1 #pragma once
2 
3 #include <variant>
4 
5 namespace mn::Graphics
6 {
7  struct Event
8  {
9  enum class ButtonType { Press, Release };
10 
11  struct None { };
12  struct Quit { };
13  struct Key
14  {
15  char key;
16  ButtonType type;
17  };
18 
19  struct MouseMove
20  {
21  Math::Vec2f delta;
22  };
23 
24  struct Wheel
25  {
26  float amount;
27  };
28 
29  struct MouseScroll
30  {
31  float delta;
32  };
33 
34  struct WindowSize
35  {
36  uint32_t new_width, new_height;
37  };
38 
39  std::variant<None, Quit, Key, WindowSize, MouseMove, MouseScroll, Wheel> event;
40  };
41 }
Definition: Event.hpp:14
Definition: Event.hpp:20
Definition: Event.hpp:30
Definition: Event.hpp:11
Definition: Event.hpp:12
Definition: Event.hpp:25
Definition: Event.hpp:35
Definition: Event.hpp:8
Definition: Vector.hpp:12