CoriEngine
Loading...
Searching...
No Matches
AppEvent.hpp
Go to the documentation of this file.
1#pragma once
2#include "Event.hpp"
3
4namespace Cori {
5 namespace Core {
6 class WindowResizeEvent final : public Event {
7 public:
8 WindowResizeEvent(const uint32_t width, const uint32_t height)
9 : m_Width(width), m_Height(height) {}
10
11 [[nodiscard]] uint32_t GetWidth() const { return m_Width; }
12 [[nodiscard]] uint32_t GetHeight() const { return m_Height; }
13
14 [[nodiscard]] std::string ToString() const override {
15 return std::string("WindowResizeEvent: (") + std::to_string(m_Width) + ", " + std::to_string(m_Height) + std::string(")");
16 }
17
20 private:
21 uint32_t m_Width{ 0 };
22 uint32_t m_Height{ 0 };
23 };
24
25 class WindowCloseEvent final : public Event {
26 public:
27 WindowCloseEvent() = default;
28
29 [[nodiscard]] std::string ToString() const override {
30 return "WindowCloseEvent";
31 }
32
35 };
36 }
37}
#define EVENT_CLASS_TYPE(type)
Assigns an EventType to the custom event type derived from the Event class. Use it in the public fiel...
Definition Event.hpp:124
#define EVENT_CLASS_CATEGORY(category)
Assigns an EventCategory to the custom event type derived from the Event class. Use it in the public ...
Definition Event.hpp:132
An abstract class that is ment to be used as a template for defining events.
Definition Event.hpp:18
std::string ToString() const override
Returns the name of the Event.
Definition AppEvent.hpp:29
uint32_t GetHeight() const
Definition AppEvent.hpp:12
uint32_t GetWidth() const
Definition AppEvent.hpp:11
std::string ToString() const override
Returns the name of the Event.
Definition AppEvent.hpp:14
WindowResizeEvent(const uint32_t width, const uint32_t height)
Definition AppEvent.hpp:8
Core systems of the engine are here.
@ EventCategoryApplication
Definition Event.hpp:7
Global engine namespace.