diff options
Diffstat (limited to 'game')
| -rw-r--r-- | game/Cargo.toml | 1 | ||||
| -rw-r--r-- | game/src/main.rs | 18 |
2 files changed, 18 insertions, 1 deletions
diff --git a/game/Cargo.toml b/game/Cargo.toml index 2792e83..b42d1c1 100644 --- a/game/Cargo.toml +++ b/game/Cargo.toml @@ -8,6 +8,7 @@ publish.workspace = true rust-version.workspace = true [dependencies] +clap.workspace = true dungeon.workspace = true graphics.workspace = true diff --git a/game/src/main.rs b/game/src/main.rs index 5c9e8c7..d96273e 100644 --- a/game/src/main.rs +++ b/game/src/main.rs @@ -1,9 +1,25 @@ +use clap::Parser; use dungeon::*; use graphics::*; +#[derive(Parser)] +struct Args { + /// Enable vsync + #[arg(long)] + vsync: bool, + // Enable verbose logging + #[arg(short, long)] + verbose: bool, +} + fn main() -> Result<()> { + // Parse arguments + let args = Args::parse(); // Load the window - let mut window = Window::new_default()?; + let mut window = WindowBuilder::new() + .vsync(args.vsync) + .verbose(args.verbose) + .build()?; // Initial game state let mut dungeon = Dungeon::new(); |