ok epic
This commit is contained in:
@@ -24,6 +24,7 @@ void App::Run()
|
||||
{
|
||||
while ( !mSIGTERM )
|
||||
{
|
||||
// Should do this ONLY on update
|
||||
mInput.PollInput();
|
||||
|
||||
// tick through game layers
|
||||
@@ -41,6 +42,7 @@ void App::Run()
|
||||
}
|
||||
|
||||
// tick through game layers *but timed*
|
||||
// TODO: Timed event thread (won't allow rendering)
|
||||
for ( const auto& layer : mGameLayers )
|
||||
{
|
||||
layer->TimeTick();
|
||||
|
||||
@@ -11,6 +11,7 @@ set(THREADS_PREFER_PTHREAD_FLAD ON)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
# Find GL and GLX package
|
||||
set(OpenGL_GL_PREFERENCE GLVND)
|
||||
find_package(OpenGL REQUIRED)
|
||||
find_package(SDL2 REQUIRED)
|
||||
|
||||
|
||||
@@ -6,77 +6,8 @@
|
||||
#include <Aeon/Aeon.hpp>
|
||||
#include <Aeon/Core/Events.hpp>
|
||||
|
||||
class BottomestLevel : public Aeon::Core::GameLayer
|
||||
{
|
||||
public:
|
||||
BottomestLevel()
|
||||
{
|
||||
UnshiftThisAsSink("GAME_LOL");
|
||||
Aeon::Core::EventManager::GetInstance().DebugPrint();
|
||||
}
|
||||
class BackgroundLevel : public Aeon::Core::GameLayer {
|
||||
|
||||
void Attach() override
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void FrameTick() override
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void TimeTick() override
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool EventRecieved(Aeon::Core::GenericEvent& e) override
|
||||
{
|
||||
std::cout << "FROM BOTTOMESTLEVEL " << e.System << " " << e.Type << " " << e.Data << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
void Detach() override
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class BottomLevel : public Aeon::Core::GameLayer
|
||||
{
|
||||
public:
|
||||
BottomLevel()
|
||||
{
|
||||
PushThisAsSink("GAME_LOL");
|
||||
Aeon::Core::EventManager::GetInstance().DebugPrint();
|
||||
}
|
||||
|
||||
void Attach() override
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void FrameTick() override
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void TimeTick() override
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool EventRecieved(Aeon::Core::GenericEvent& e) override
|
||||
{
|
||||
std::cout << "FROM BOTTOMLEVEL " << e.System << " " << e.Type << " " << e.Data << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
void Detach() override
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
class Level : public Aeon::Core::GameLayer
|
||||
@@ -84,54 +15,12 @@ class Level : public Aeon::Core::GameLayer
|
||||
public:
|
||||
Level()
|
||||
{
|
||||
mEventDispatcher.RegisterAsSource("GAME_LOL");
|
||||
PushThisAsSink("GAME_LOL");
|
||||
PushThisAsSink("ENGINE_INPUT_KEYBOARD");
|
||||
Aeon::Core::EventManager::GetInstance().DebugPrint();
|
||||
}
|
||||
|
||||
void Attach() override
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void FrameTick() override
|
||||
{
|
||||
mEventDispatcher.Dispatch("Lmao gottem");
|
||||
|
||||
}
|
||||
|
||||
void TimeTick() override
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool EventRecieved( Aeon::Core::GenericEvent& e ) override
|
||||
{
|
||||
std::cout << "FROM LEVEL " << e.System << " " << e.Type << " " << e.Data << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
void Detach() override
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Aeon::Core::EventDispatcher mEventDispatcher;
|
||||
|
||||
};
|
||||
|
||||
class TopLevel : public Aeon::Core::GameLayer
|
||||
{
|
||||
public:
|
||||
TopLevel()
|
||||
{
|
||||
PushAndStickThisAsSink("GAME_LOL");
|
||||
Aeon::Core::EventManager::GetInstance().DebugPrint();
|
||||
}
|
||||
|
||||
void Attach() override
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void FrameTick() override
|
||||
@@ -146,43 +35,7 @@ public:
|
||||
|
||||
bool EventRecieved( Aeon::Core::GenericEvent& e ) override
|
||||
{
|
||||
std::cout << "FROM TOPLEVEL " << e.System << " " << e.Type << " " << e.Data << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
void Detach() override
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
class ToperLevel : public Aeon::Core::GameLayer
|
||||
{
|
||||
public:
|
||||
ToperLevel()
|
||||
{
|
||||
PushAndStickThisAsSink("GAME_LOL");
|
||||
Aeon::Core::EventManager::GetInstance().DebugPrint();
|
||||
}
|
||||
|
||||
void Attach() override
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void FrameTick() override
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void TimeTick() override
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool EventRecieved(Aeon::Core::GenericEvent& e) override
|
||||
{
|
||||
std::cout << "FROM TOPERLEVEL " << e.System << " " << e.Type << " " << e.Data << std::endl;
|
||||
std::cout << "FROM LEVEL " << e.System << " " << (char)e.keyCode << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -200,16 +53,8 @@ public:
|
||||
ExampleGame()
|
||||
: App( { "Example" }, { "Game with AEON!" } )
|
||||
{
|
||||
BottomestLevel* bottomestLevel = new BottomestLevel;
|
||||
BottomLevel* bottomLevel = new BottomLevel;
|
||||
Level* level = new Level;
|
||||
TopLevel* topLevel = new TopLevel;
|
||||
ToperLevel* toperLevel = new ToperLevel;
|
||||
PushLayer( (Aeon::Core::GameLayer*)bottomestLevel );
|
||||
PushLayer( (Aeon::Core::GameLayer*)bottomLevel );
|
||||
PushLayer( (Aeon::Core::GameLayer*)level );
|
||||
PushLayer( (Aeon::Core::GameLayer*)topLevel );
|
||||
PushLayer( (Aeon::Core::GameLayer*)toperLevel);
|
||||
Run();
|
||||
delete level;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user