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