diff options
author | Jon Santmyer <jon@jonsantmyer.com> | 2022-06-22 17:41:59 -0400 |
---|---|---|
committer | Jon Santmyer <jon@jonsantmyer.com> | 2022-06-22 17:41:59 -0400 |
commit | 5e3a2492c7bb73daa4e27398daaf490d09980ff3 (patch) | |
tree | 75178d823d596b6a898002c3f1d45b9ceede0e1e /src/main.cpp | |
download | systemviewer-5e3a2492c7bb73daa4e27398daaf490d09980ff3.tar.gz systemviewer-5e3a2492c7bb73daa4e27398daaf490d09980ff3.tar.bz2 systemviewer-5e3a2492c7bb73daa4e27398daaf490d09980ff3.zip |
Base system viewer with data loaded from csv files
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..9ff09a6 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,26 @@ +#include <iostream> +#include "game.hpp" + +#include <sys/ioctl.h> +#include <fcntl.h> +#include <unistd.h> + +int +main(int argc, char **argv) +{ + (void)argc; + (void)argv; + + struct winsize w; + ioctl(STDOUT_FILENO, TIOCGWINSZ, &w); + fcntl(STDIN_FILENO, F_SETFL, fcntl(0, F_GETFL) | O_NONBLOCK); + + Game::setup(w.ws_col, w.ws_row); + + while(Game::running()) { + Game::turn(); + } + + Game::cleanup(); + return 0; +} |