Hana
Loading...
Searching...
No Matches
ApplicationEvent.h
1#pragma once
2
3#include "Hana/Events/Event.h"
4
5namespace Hana
6{
7 class WindowResizeEvent : public Event
8 {
9 public:
10 WindowResizeEvent(unsigned int width, unsigned int height)
11 : m_Width(width), m_Height(height) {}
12
13 inline unsigned int GetWidth() const { return m_Width; }
14 inline unsigned int GetHeight() const { return m_Height; }
15
16 std::string ToString() const override
17 {
18 std::stringstream ss;
19 ss << "WindowResizeEvent: " << m_Width << ", " << m_Height;
20 return ss.str();
21 }
22
23 EVENT_CLASS_TYPE(WindowResize)
24 EVENT_CLASS_CATEGORY(EventCategoryApplication)
25 private:
26 unsigned int m_Width, m_Height;
27 };
28
29 class WindowCloseEvent : public Event
30 {
31 public:
32 WindowCloseEvent() = default;
33
34 EVENT_CLASS_TYPE(WindowClose)
35 EVENT_CLASS_CATEGORY(EventCategoryApplication)
36 };
37
38 class AppTickEvent : public Event
39 {
40 public:
41 AppTickEvent() = default;
42
43 EVENT_CLASS_TYPE(AppTick)
44 EVENT_CLASS_CATEGORY(EventCategoryApplication)
45 };
46
47 class AppUpdateEvent : public Event
48 {
49 public:
50 AppUpdateEvent() = default;
51
52 EVENT_CLASS_TYPE(AppUpdate)
53 EVENT_CLASS_CATEGORY(EventCategoryApplication)
54 };
55
56 class AppRenderEvent : public Event
57 {
58 public:
59 AppRenderEvent() = default;
60
61 EVENT_CLASS_TYPE(AppRender)
62 EVENT_CLASS_CATEGORY(EventCategoryApplication)
63 };
64}
Definition Event.h:39