feat(Core): functions to run and stop the core#122
Conversation
The point is to prevent the user to define the core loop logic inside the game code, but let them only call the run and stop functions.
…gineSquared/EngineSquared into 101-run-all-systems-of-core-in-a-loop
|
How will this affect usage with our windows plugins ? I am talking about the "window should close" methods |
Please provide an example like this |
|
Since I tested it from the current Raylib implementation of the GameDemo, the windows plugins should works the same way. As an example, the current implementation let the user define a new system to handle whenever the window should close like this: core.RegisterSystem<ES::Engine::Scheduler::RelativeTimeUpdate>(Game::RunLoop);This system being as simple as this: void Game::RunLoop(ES::Engine::Core &core)
{
if (Raylib::WindowShouldClose())
core.Stop();
}We can simply call the runCore function now to run the systems. This avoids having to write a loop condition outside of the core to handle their execution, but inside as systems: core.RunCore(); |
Okay, fix conflicts and it's good |
|



Related to:
Providing functions to handle the core state, in order to avoid defining the core loop in the game code.