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 "Event.h"
13
14namespace Karma
15{
20 {
21 public:
31 WindowResizeEvent(unsigned int width, unsigned int height)
32 : m_Width(width), m_Height(height)
33 {
34 }
35
41 inline unsigned int GetWidth() const { return m_Width; }
42
48 inline unsigned int GetHeight() const { return m_Height; }
49
55 std::string ToString() const override
56 {
57 std::stringstream ss;
58 ss << "WindowResizeEvent: " << m_Width << ", " << m_Height;
59 return ss.str();
60 }
61
62 EVENT_CLASS_TYPE(WindowResize)
64
65 private:
66 unsigned int m_Width, m_Height;
67 };
68
73 {
74 public:
82 {
83 }
84
85 EVENT_CLASS_TYPE(WindowClose)
87 };
88
93 {
94 public:
101 {
102 }
103
104 EVENT_CLASS_TYPE(AppTick)
106 };
107
111 class KARMA_API AppUpdateEvent : public Event
112 {
113 public:
114 AppUpdateEvent()
115 {
116 }
117
118 EVENT_CLASS_TYPE(AppUpdate)
120 };
121
125 class KARMA_API AppRenderEvent : public Event
126 {
127 public:
128 AppRenderEvent()
129 {
130 }
131
132 EVENT_CLASS_TYPE(AppRender)
134 };
135}
#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:40
#define EVENT_CLASS_TYPE(type)
A macro for a template for Event based classes.
Definition Event.h:73
#define EVENT_CLASS_CATEGORY(category)
Macro for the routine category flags.
Definition Event.h:82
AppTickEvent()
A constructor.
Definition ApplicationEvent.h:100
The base class of all the events for Karma.
Definition Event.h:88
WindowCloseEvent()
A constructor.
Definition ApplicationEvent.h:81
WindowResizeEvent(unsigned int width, unsigned int height)
A constructor.
Definition ApplicationEvent.h:31
unsigned int GetWidth() const
Getter for width size.
Definition ApplicationEvent.h:41
unsigned int GetHeight() const
Getter for height size.
Definition ApplicationEvent.h:48
std::string ToString() const override
String representation of the event.
Definition ApplicationEvent.h:55