10#include <spdlog/fmt/fmt.h>
30 WindowResizeEvent(std::uint32_t width, std::uint32_t height) : m_Width(width), m_Height(height) {}
33 std::uint32_t
GetWidth()
const {
return m_Width; }
36 std::uint32_t
GetHeight()
const {
return m_Height; }
39 std::string
ToString()
const override {
return fmt::format(
"{}: {}x{}",
GetName(), m_Width, m_Height); }
42 std::uint32_t m_Width = 0;
43 std::uint32_t m_Height = 0;
58 std::string
ToString()
const override {
return fmt::format(
"{}: {}",
GetName(), m_Focused ?
"gained" :
"lost"); }
61 bool m_Focused =
false;
79 std::string
ToString()
const override {
return fmt::format(
"{}: {}",
GetName(), m_Minimized ?
"minimized" :
"restored"); }
82 bool m_Minimized =
false;
Base class of all events, with their types and categories.
Base class of each event class, which gives the event its type and its categories.
Definition Event.h:148
const char * GetName() const
Returns the name of the type of the event, for example "KeyPressed".
Definition Event.h:112
Sent when the user asks to close the window, for example with the close button.
Definition WindowEvent.h:19
std::string ToString() const override
Returns the event with the change, for example "WindowFocus: gained".
Definition WindowEvent.h:58
WindowFocusEvent(bool focused)
Creates the event.
Definition WindowEvent.h:52
bool IsFocused() const
Returns true if the window gained the focus, false if it lost it.
Definition WindowEvent.h:55
WindowMinimizeEvent(bool minimized)
Creates the event.
Definition WindowEvent.h:73
bool IsMinimized() const
Returns true if the window was minimized, false if it was restored.
Definition WindowEvent.h:76
std::string ToString() const override
Returns the event with the change, for example "WindowMinimize: minimized".
Definition WindowEvent.h:79
std::uint32_t GetWidth() const
Returns the new width, in pixels.
Definition WindowEvent.h:33
std::string ToString() const override
Returns the event with its size, for example "WindowResize: 1280x720".
Definition WindowEvent.h:39
WindowResizeEvent(std::uint32_t width, std::uint32_t height)
Creates the event with the new size, in pixels.
Definition WindowEvent.h:30
std::uint32_t GetHeight() const
Returns the new height, in pixels.
Definition WindowEvent.h:36
Contains all the engine code.