KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
ApplicationEvent.h
Go to the documentation of this file.
1
10#pragma once
11
12#include "krpch.h"
13
14#include "Event.h"
15
16namespace Karma
17{
22 {
23 public:
33 WindowResizeEvent(unsigned int width, unsigned int height)
34 : m_Width(width), m_Height(height)
35 {
36 }
37
43 inline unsigned int GetWidth() const { return m_Width; }
44
50 inline unsigned int GetHeight() const { return m_Height; }
51
57 std::string ToString() const override
58 {
59 std::stringstream ss;
60 ss << "WindowResizeEvent: " << m_Width << ", " << m_Height;
61 return ss.str();
62 }
63
64 EVENT_CLASS_TYPE(WindowResize)
66
67 private:
68 unsigned int m_Width, m_Height;
69 };
70
75 {
76 public:
84 {
85 }
86
87 EVENT_CLASS_TYPE(WindowClose)
89 };
90
95 {
96 public:
103 {
104 }
105
106 EVENT_CLASS_TYPE(AppTick)
108 };
109
113 class KARMA_API AppUpdateEvent : public Event
114 {
115 public:
116 AppUpdateEvent()
117 {
118 }
119
120 EVENT_CLASS_TYPE(AppUpdate)
122 };
123
127 class KARMA_API AppRenderEvent : public Event
128 {
129 public:
130 AppRenderEvent()
131 {
132 }
133
134 EVENT_CLASS_TYPE(AppRender)
136 };
137}
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
This file contains the base class Event for Karma's events.
@ EventCategoryApplication
Events belonging to application specific processes (resizing and movement for instance)
Definition Event.h:42
#define EVENT_CLASS_TYPE(type)
A macro for a template for Event based classes.
Definition Event.h:75
#define EVENT_CLASS_CATEGORY(category)
Macro for the routine category flags.
Definition Event.h:84
AppTickEvent()
A constructor.
Definition ApplicationEvent.h:102
The base class of all the events for Karma.
Definition Event.h:90
WindowCloseEvent()
A constructor.
Definition ApplicationEvent.h:83
WindowResizeEvent(unsigned int width, unsigned int height)
A constructor.
Definition ApplicationEvent.h:33
unsigned int GetWidth() const
Getter for width size.
Definition ApplicationEvent.h:43
unsigned int GetHeight() const
Getter for height size.
Definition ApplicationEvent.h:50
std::string ToString() const override
String representation of the event.
Definition ApplicationEvent.h:57