Vesper 0.5.1
Vesper is short form for the Latin word for "Bat", as Vesper is designed to be small, lightweight, and easily handle things like particles and flocking behaviors in accordance with the nature of bats. \n It is meant to be a particle simulation, VFX editor, and CAN be used secondarily as a small game engine.
GitHub | Vesper Updates | Creator
Loading...
Searching...
No Matches
Vesper::Event Class Referenceabstract

Abstract base class for all events. More...

#include <Event.h>

Inheritance diagram for Vesper::Event:
Vesper::AppRenderEvent Vesper::AppTickEvent Vesper::AppUpdateEvent Vesper::KeyEvent Vesper::MouseButtonEvent Vesper::MouseMovedEvent Vesper::MouseScrolledEvent Vesper::WindowCloseEvent Vesper::WindowResizeEvent

Public Member Functions

virtual ~Event ()=default
virtual EventType GetEventType () const =0
 Get the type of the event.
virtual const char * GetName () const =0
 Get the name of the event.
virtual int GetCategoryFlags () const =0
 Get the category flags of the event.
virtual std::string ToString () const
 Convert the event to a string representation.
bool IsInCategory (EventCategory category)
 Check if the event is in a specific category.

Public Attributes

bool Handled = false
 Indicates whether the event has been handled.

Friends

class EventDispatcher

Detailed Description

Abstract base class for all events.

Constructor & Destructor Documentation

◆ ~Event()

virtual Vesper::Event::~Event ( )
virtualdefault

Member Function Documentation

◆ GetCategoryFlags()

virtual int Vesper::Event::GetCategoryFlags ( ) const
pure virtual

Get the category flags of the event.

Referenced by IsInCategory().

◆ GetEventType()

virtual EventType Vesper::Event::GetEventType ( ) const
pure virtual

Get the type of the event.

◆ GetName()

virtual const char * Vesper::Event::GetName ( ) const
pure virtual

Get the name of the event.

Referenced by ToString().

◆ IsInCategory()

bool Vesper::Event::IsInCategory ( EventCategory category)
inline

Check if the event is in a specific category.

56 {
57 return GetCategoryFlags() & category;
58 }
virtual int GetCategoryFlags() const =0
Get the category flags of the event.

References GetCategoryFlags().

Referenced by Vesper::ImGuiLayer::OnEvent().

◆ ToString()

virtual std::string Vesper::Event::ToString ( ) const
inlinevirtual

Convert the event to a string representation.

Reimplemented in Vesper::KeyPressedEvent, Vesper::KeyReleasedEvent, Vesper::KeyTypedEvent, Vesper::MouseButtonPressedEvent, Vesper::MouseButtonReleasedEvent, Vesper::MouseMovedEvent, Vesper::MouseScrolledEvent, and Vesper::WindowResizeEvent.

52{ return GetName(); }
virtual const char * GetName() const =0
Get the name of the event.

References GetName().

◆ EventDispatcher

friend class EventDispatcher
friend

Member Data Documentation

◆ Handled

bool Vesper::Event::Handled = false

Indicates whether the event has been handled.

Referenced by Vesper::ImGuiLayer::OnEvent().


The documentation for this class was generated from the following file: