diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-13 14:05:11 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-13 14:05:11 +0200 |
commit | 165c1ae6e4a4eea35d7ea2f2a6518ff36cf0112f (patch) | |
tree | 78ab1efe1154551581808814ff962154b053ae23 /main.cpp | |
parent | 1a30375e369d2d872cb3fd6ecdc6019136c7b1a4 (diff) |
separate view and museum thread
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -10,9 +10,9 @@ using namespace std; -void load_museum(Museum & m, int argc, char** argv) { +void load_museum(Museum & museum, int argc, char** argv) { Deserializer d {}; - d.set_target(&m); + d.set_target(&museum); for (int i = 1; i < argc; i++) { char * url = argv[i]; @@ -39,19 +39,19 @@ void load_museum(Museum & m, int argc, char** argv) { } int main(int argc, char** argv) { - Museum m {}; - load_museum(m, argc, argv); + Museum museum {}; + museum.paused = true; - printf("%s", m.canvas.to_string(true).c_str()); - printf("%s", m.people.to_string().c_str()); + load_museum(museum, argc, argv); - View v {}; - ViewController vc {v, m}; + // printf("%s", museum.canvas.to_string(true).c_str()); + // printf("%s", museum.people.to_string().c_str()); - while (v.open) { - m.update(); - vc.update(); - } + ViewController controller { museum }; + View view { controller }; + + museum.paused = false; + while (view.open); return EXIT_SUCCESS; } |