Raven Engine v0.1
Loading...
Searching...
No Matches
Events

Event system. More...

Classes

class  Raven::EventDispatcher
 Routes an Event to a matching handler function. More...
class  Raven::WindowResizeEvent
 Event triggered when the main window is resized. More...
class  Raven::WindowCloseEvent
 Event triggered when the window is requested to close. More...
class  Raven::AppTickEvent
 Event triggered once per tick cycle. More...
class  Raven::AppUpdateEvent
 Event triggered once per application update. More...
class  Raven::AppRenderEvent
 Event triggered once per application render. More...
class  Raven::Event
 Abstract base class for all events in Raven. More...
class  Raven::MouseMovedEvent
 Event triggered when the mouse is moved. More...

Macros

#define EVENT_CLASS_TYPE(type)
 Macro to implement type functions for custom Event subclasses.
#define EVENT_CLASS_CATEGORY(category)
 Macro to implement category function for custom Event subclasses.

Enumerations

enum class  Raven::EventType : u8 {
  Raven::EventType::None = 0 , Raven::EventType::WindowClose , Raven::EventType::WindowResize , Raven::EventType::WindowFocus ,
  Raven::EventType::WindowLostFocus , Raven::EventType::WindowMoved , Raven::EventType::AppTick , Raven::EventType::AppUpdate ,
  Raven::EventType::AppRender , Raven::EventType::KeyPressed , Raven::EventType::KeyReleased , Raven::EventType::MouseButtonPressed ,
  Raven::EventType::MouseButtonReleased , Raven::EventType::MouseMoved , Raven::EventType::MouseScrolled
}
 Identifiers for all possible event types in the engine. More...
enum class  Raven::EventCategory : u8 {
  Raven::EventCategory::None = 0 , Raven::EventCategory::Application = 0 << 1 , Raven::EventCategory::Input = 1 << 1 , Raven::EventCategory::Keyboard = 1 << 2 ,
  Raven::EventCategory::Mouse = 1 << 3 , Raven::EventCategory::MouseButton = 1 << 4
}
 Primary categories and subcategories for engine events. More...

Functions

std::ostream & Raven::operator<< (std::ostream &os, const Event &e)
 Stream insertion operator for events.

Detailed Description

Event system.

Macro Definition Documentation

◆ EVENT_CLASS_CATEGORY

#define EVENT_CLASS_CATEGORY ( category)
Value:
EventCategory GetCategoryFlags() const override \
{ \
return category; \
}

Macro to implement category function for custom Event subclasses.

Parameters
categoryThe EventCategory bitflags for this class.

◆ EVENT_CLASS_TYPE

#define EVENT_CLASS_TYPE ( type)
Value:
static EventType GetStaticType() \
{ \
return EventType::type; \
} \
EventType GetEventType() const override \
{ \
return GetStaticType(); \
} \
const char* GetName() const override \
{ \
return #type; \
}

Macro to implement type functions for custom Event subclasses.

Parameters
typeThe EventType enum value for this class.

Enumeration Type Documentation

◆ EventCategory

enum class Raven::EventCategory : u8
strong

Primary categories and subcategories for engine events.

Values are powers-of-two to allow bitmask combinations.

Enumerator
None 

No category.

Application 

Application-level events (startup, shutdown).

Input 

Raw input events (any device).

Keyboard 

Keyboard-specific events.

Mouse 

Mouse movement events.

MouseButton 

Mouse button press/release events.

◆ EventType

enum class Raven::EventType : u8
strong

Identifiers for all possible event types in the engine.

Enumerator
None 

No event.

WindowClose 

Window close requested.

WindowResize 

Window resized.

WindowFocus 

Window gained focus.

WindowLostFocus 

Window lost focus.

WindowMoved 

Window moved.

AppTick 

Application tick.

AppUpdate 

Application update.

AppRender 

Application render.

KeyPressed 

Key pressed.

KeyReleased 

Key released.

MouseButtonPressed 

Mouse button pressed.

MouseButtonReleased 

Mouse button released.

MouseMoved 

Mouse moved.

MouseScrolled 

Mouse wheel scrolled.

Function Documentation

◆ operator<<()

std::ostream & Raven::operator<< ( std::ostream & os,
const Event & e )
inline

Stream insertion operator for events.

Parameters
osOutput stream.
eThe event to write.
Returns
The stream.