Moved the main event loop out of GUI so it's not so tightly coupled to everything else.
This commit is contained in:
parent
c0ad0c8d23
commit
5ae24d9b0a
4 changed files with 22 additions and 23 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue