bruh
This commit is contained in:
@@ -71,5 +71,9 @@ unsigned int Display::GetHeight()
|
||||
|
||||
void Display::Destroy()
|
||||
{
|
||||
|
||||
SDL_DestroyWindow( mWindow );
|
||||
// dangly balls
|
||||
mWindow = nullptr;
|
||||
mWidth = 0;
|
||||
mHeight = 0;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
0
Aeon/Debug/Profiler.hpp
Normal file
20
Aeon/Input/Input.cpp
Normal file
20
Aeon/Input/Input.cpp
Normal 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
19
Aeon/Input/Input.hpp
Normal 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
23
Aeon/Singleton.hpp
Normal 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
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -12,7 +12,6 @@ public:
|
||||
: App( { "Game with AEON!" } )
|
||||
{
|
||||
Run();
|
||||
|
||||
}
|
||||
|
||||
~ExampleGame()
|
||||
|
||||
Reference in New Issue
Block a user