From a6fb1b2d113e1c4e8e58d772b386b999e02e9552 Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 14 Aug 2021 01:44:46 +0100 Subject: [PATCH] events hmmmm --- Aeon/Aeon.hpp | 3 ++- Aeon/Core/Display.hpp | 4 ++-- Aeon/Core/EngineEvents.hpp | 35 +++++++++++++++++++++++++++++++++++ Game/ExampleGame.cpp | 9 ++++++--- 4 files changed, 45 insertions(+), 6 deletions(-) diff --git a/Aeon/Aeon.hpp b/Aeon/Aeon.hpp index 8184e15..eeb04ab 100644 --- a/Aeon/Aeon.hpp +++ b/Aeon/Aeon.hpp @@ -7,7 +7,8 @@ namespace Aeon::Core { -class AppProperties { +class AppProperties +{ public: std::string Name; int Width, Height; diff --git a/Aeon/Core/Display.hpp b/Aeon/Core/Display.hpp index e4854e3..23ae526 100644 --- a/Aeon/Core/Display.hpp +++ b/Aeon/Core/Display.hpp @@ -1,5 +1,5 @@ -#ifndef AEON_DISPLAY_H_ -#define AEON_DISPLAY_H_ +#ifndef AEON_CORE_DISPLAY_H_ +#define AEON_CORE_DISPLAY_H_ namespace Aeon::Core { diff --git a/Aeon/Core/EngineEvents.hpp b/Aeon/Core/EngineEvents.hpp index e69de29..9f01c7a 100644 --- a/Aeon/Core/EngineEvents.hpp +++ b/Aeon/Core/EngineEvents.hpp @@ -0,0 +1,35 @@ +#ifndef AEON_CORE_ENGINEEVENTS_H_ +#define AEON_CORE_ENGINEEVENTS_H_ + +/* + - events are typed and system'd + - systems can request to only receive events from a certain "system" category + - systems that dispatch events can create the event and register it as a type + - events are queued and non - blocking + - events propagate through game layers top - to - bottom + - once an event is flagged as handled by a receiving system, + it is discarded this is to prevent, say a "mouse click" + from propagating from the UI layer to the game layer +*/ + +namespace Aeon::Core { + + +enum EventSystem +{ + +}; + +class GenericEvent +{ + +}; + +class EventDispatcher +{ + +}; + +} + +#endif diff --git a/Game/ExampleGame.cpp b/Game/ExampleGame.cpp index 41fd3c9..71086a8 100644 --- a/Game/ExampleGame.cpp +++ b/Game/ExampleGame.cpp @@ -1,11 +1,14 @@ // simple raycast shooter +// shotgun fun fun yanno #include "Aeon/Aeon.hpp" -class ExampleGame : public Aeon::Core::App { +class ExampleGame : public Aeon::Core::App +{ public: - ExampleGame() + // take command line args better (parse them first!) + ExampleGame( int argc, char** argv ) : App( { "Game with AEON!" } ) { @@ -20,5 +23,5 @@ public: int main( int argc, char** argv ) { - ExampleGame game; + ExampleGame game(argc, argv); }