KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Event.h File Reference

This file contains the base class Event for Karma's events. More...

#include "krpch.h"
Include dependency graph for Event.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Karma::Event
 The base class of all the events for Karma. More...
 
class  Karma::EventDispatcher
 Class for dispatching events. More...
 

Macros

#define EVENT_CLASS_TYPE(type)
 A macro for a template for Event based classes.
 
#define EVENT_CLASS_CATEGORY(category)
 Macro for the routine category flags.
 

Enumerations

enum class  Karma::EventType {
  None = 0 , WindowClose , WindowResize , WindowFocus ,
  WindowLostFocus , WindowMoved , AppTick , AppUpdate ,
  AppRender , KeyPressed , KeyReleased , KeyTyped ,
  MouseButtonPressed , MouseButtonReleased , MouseMoved , MouseScrolled ,
  GameControllerConnected , GameControllerDisconnected
}
 Collection of events used by the Engine.
 
enum  Karma::EventCategory {
  Karma::None = 0 , Karma::EventCategoryApplication = BIT(0) , Karma::EventCategoryInput = BIT(1) , Karma::EventCategoryKeyboard = BIT(2) ,
  Karma::EventCategoryMouse = BIT(3) , Karma::EventCategoryMouseButton = BIT(4) , Karma::EventCategoryGameControllerDevice = BIT(5)
}
 Classification of the above events. More...
 

Detailed Description

This file contains the base class Event for Karma's events.

Author
Ravi Mohan (the_cowboy)
Version
1.0
Date
November 28, 2020

Macro Definition Documentation

◆ EVENT_CLASS_CATEGORY

#define EVENT_CLASS_CATEGORY ( category)
Value:
virtual int GetCategoryFlags() const override { return category; }

Macro for the routine category flags.

Since
Karma 1.0.0

◆ EVENT_CLASS_TYPE

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

A macro for a template for Event based classes.

Since
Karma 1.0.0

Enumeration Type Documentation

◆ EventCategory

Classification of the above events.

Enumerator
None 

Events of the unknown category.

EventCategoryApplication 

Events belonging to application specific processes (resizing and movement for instance)

EventCategoryInput 

Events belonging to game inputs. Input device examples include keyboard, mouse, and all that.

EventCategoryKeyboard 

Events belonging to game inputs from keyboard (keyboard buttons pressing for instance)

EventCategoryMouse 

Events belonging to game movement inputs from mouse.

EventCategoryMouseButton 

Events belonging to game button inputs from mouse (mouse buttons pressing for instance)

EventCategoryGameControllerDevice 

Events belonging to game controller devices' input.