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
20
gui.cpp
20
gui.cpp
|
@ -31,22 +31,10 @@ void GUI::output(const string msg) {
|
|||
_lines.push_back(msg);
|
||||
}
|
||||
|
||||
int GUI::main_loop(GameEngine &game, Builder &builder) {
|
||||
auto gui = SFMLBackend(game);
|
||||
|
||||
gui.startup();
|
||||
|
||||
while(gui.is_open()) {
|
||||
builder.event(BuildEvent::GO);
|
||||
gui.handle_events();
|
||||
gui.update_entities();
|
||||
gui.update_log(_lines);
|
||||
}
|
||||
|
||||
builder.event(BuildEvent::QUIT);
|
||||
|
||||
gui.shutdown();
|
||||
return EXIT_SUCCESS;
|
||||
void GUI::main_loop(SFMLBackend &gui) {
|
||||
gui.handle_events();
|
||||
gui.update_entities();
|
||||
gui.update_log(_lines);
|
||||
}
|
||||
|
||||
void GUI::build_works() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue