diff --git a/Aeon/Core/Display.cpp b/Aeon/Core/Display.cpp index f94e002..a9ddfed 100644 --- a/Aeon/Core/Display.cpp +++ b/Aeon/Core/Display.cpp @@ -71,5 +71,9 @@ unsigned int Display::GetHeight() void Display::Destroy() { - + SDL_DestroyWindow( mWindow ); + // dangly balls + mWindow = nullptr; + mWidth = 0; + mHeight = 0; } diff --git a/Aeon/Core/Display.hpp b/Aeon/Core/Display.hpp index 5fdef50..fae4866 100644 --- a/Aeon/Core/Display.hpp +++ b/Aeon/Core/Display.hpp @@ -4,13 +4,14 @@ #include #include +extern "C" { #include +} namespace Aeon::Core { -class DisplayProperties +struct DisplayProperties { -public: std::string Name; int Width, Height; bool VSync; diff --git a/Aeon/Profiling/Profiler.hpp b/Aeon/Core/Events.cpp similarity index 100% rename from Aeon/Profiling/Profiler.hpp rename to Aeon/Core/Events.cpp diff --git a/Aeon/Core/EngineEvents.hpp b/Aeon/Core/Events.hpp similarity index 53% rename from Aeon/Core/EngineEvents.hpp rename to Aeon/Core/Events.hpp index 4028430..02bc8c2 100644 --- a/Aeon/Core/EngineEvents.hpp +++ b/Aeon/Core/Events.hpp @@ -1,8 +1,8 @@ -#ifndef AEON_CORE_ENGINEEVENTS_H_ -#define AEON_CORE_ENGINEEVENTS_H_ +#ifndef AEON_CORE_EVENTS_H_ +#define AEON_CORE_EVENTS_H_ /* - - events are typed and system'd + - events are typed and system'd using a subscriber/publisher-esque observer pattern - 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 @@ -12,18 +12,37 @@ from propagating from the UI layer to the game layer */ +#include "Aeon/Singleton.hpp" + namespace Aeon::Core { -class GenericEvent +struct GenericEvent { }; -class EventDispatcher +struct Dispatcher { }; +class EventListener +{ +public: + EventListener(); + virtual ~EventListener(); +}; + +class EventManager : public Aeon::Helpers::Singleton +{ +public: + + + void RegisterDispatcher(); + + void Dispatch( GenericEvent& e ); +}; + } #endif diff --git a/Aeon/Debug/Profiler.hpp b/Aeon/Debug/Profiler.hpp new file mode 100644 index 0000000..e69de29 diff --git a/Aeon/Input/Input.cpp b/Aeon/Input/Input.cpp new file mode 100644 index 0000000..8a0936c --- /dev/null +++ b/Aeon/Input/Input.cpp @@ -0,0 +1,20 @@ +#include "Aeon/Input/Input.hpp" +#include "Aeon/Core/Events.hpp" + +using Aeon::Input::Input; + +Input::Input() +{ + +} + +Input::~Input() +{ + +} + +void Input::PollInput() +{ + +} + diff --git a/Aeon/Input/Input.hpp b/Aeon/Input/Input.hpp new file mode 100644 index 0000000..9326975 --- /dev/null +++ b/Aeon/Input/Input.hpp @@ -0,0 +1,19 @@ +#ifndef AEON_INPUT_INPUT_H_ +#define AEON_INPUT_INPUT_H_ + +#include "Aeon/Singleton.hpp" + +namespace Aeon::Input { + +class Input : public Aeon::Helpers::Singleton +{ +public: + Input(); + ~Input(); + + void PollInput(); +}; + +} + +#endif diff --git a/Aeon/Singleton.hpp b/Aeon/Singleton.hpp new file mode 100644 index 0000000..a2441d9 --- /dev/null +++ b/Aeon/Singleton.hpp @@ -0,0 +1,23 @@ +#ifndef AEON_SINGLETON_H_ +#define AEON_SINGLETON_H_ + +namespace Aeon::Helpers { + +template +class Singleton +{ + static T& GetInstance() + { + static T instance; + return instance; + } + + Singleton( Singleton const& ) = delete; + void operator=( Singleton const& ) = delete; +protected: + Singleton() = default; +}; + +} + +#endif diff --git a/CMakeLists.txt b/CMakeLists.txt index cdf0aef..7287ee6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,8 +23,9 @@ set(Aeon Aeon) file(GLOB EngineSource Aeon/*.cpp Aeon/Core/*.cpp + Aeon/Debug/*.cpp + Aeon/Input/*.cpp Aeon/Maths/*.cpp - Aeon/Profiling/*.cpp Aeon/ThirdParty/*.cpp Aeon/ThirdParty/*.c ) diff --git a/Game/ExampleGame.cpp b/Game/ExampleGame.cpp index 434bcc6..0f94495 100644 --- a/Game/ExampleGame.cpp +++ b/Game/ExampleGame.cpp @@ -12,7 +12,6 @@ public: : App( { "Game with AEON!" } ) { Run(); - } ~ExampleGame()