Moved the main event loop out of GUI so it's not so tightly coupled to everything else.

This commit is contained in:
Zed A. Shaw 2024-09-10 22:58:45 -04:00
parent c0ad0c8d23
commit 5ae24d9b0a
4 changed files with 22 additions and 23 deletions

View file

@ -4,11 +4,19 @@
int main(int argc, char *argv[])
{
GUI gui;
GameEngine game{100};
GUI gui;
GameEngine game{100};
auto backend = SFMLBackend(game);
auto builder = Builder(gui, game);
auto builder = Builder(gui, game);
gui.main_loop(game, builder);
backend.startup();
return 1;
while(backend.is_open()) {
builder.event(BuildEvent::GO);
gui.main_loop(backend);
}
builder.event(BuildEvent::QUIT);
backend.shutdown();
return 1;
}