This commit is contained in:
Ben
2021-08-16 20:15:27 +01:00
parent cab2d2fe38
commit dda047f7ea
10 changed files with 96 additions and 10 deletions

View File

@@ -71,5 +71,9 @@ unsigned int Display::GetHeight()
void Display::Destroy()
{
SDL_DestroyWindow( mWindow );
// dangly balls
mWindow = nullptr;
mWidth = 0;
mHeight = 0;
}

View File

@@ -4,13 +4,14 @@
#include <string>
#include <SDL.h>
extern "C" {
#include <ThirdParty/glad.h>
}
namespace Aeon::Core {
class DisplayProperties
struct DisplayProperties
{
public:
std::string Name;
int Width, Height;
bool VSync;

View File

@@ -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<EventManager>
{
public:
void RegisterDispatcher();
void Dispatch( GenericEvent& e );
};
}
#endif

0
Aeon/Debug/Profiler.hpp Normal file
View File

20
Aeon/Input/Input.cpp Normal file
View File

@@ -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()
{
}

19
Aeon/Input/Input.hpp Normal file
View File

@@ -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<Input>
{
public:
Input();
~Input();
void PollInput();
};
}
#endif

23
Aeon/Singleton.hpp Normal file
View File

@@ -0,0 +1,23 @@
#ifndef AEON_SINGLETON_H_
#define AEON_SINGLETON_H_
namespace Aeon::Helpers {
template <class T>
class Singleton
{
static T& GetInstance()
{
static T instance;
return instance;
}
Singleton( Singleton const& ) = delete;
void operator=( Singleton const& ) = delete;
protected:
Singleton() = default;
};
}
#endif

View File

@@ -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
)

View File

@@ -12,7 +12,6 @@ public:
: App( { "Game with AEON!" } )
{
Run();
}
~ExampleGame()