summaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-11-10 13:31:04 -0500
committerFreya Murphy <freya@freyacat.org>2025-11-10 13:31:04 -0500
commitb50a79e6f9cd09973a406e5ccc50510aee3423f2 (patch)
tree67d7dd951cc5680f6e2526f48bef7b1bde5db1c3 /game
parentupdate raylib to 5.6-dev (diff)
downloadDungeonCrawl-b50a79e6f9cd09973a406e5ccc50510aee3423f2.tar.gz
DungeonCrawl-b50a79e6f9cd09973a406e5ccc50510aee3423f2.tar.bz2
DungeonCrawl-b50a79e6f9cd09973a406e5ccc50510aee3423f2.zip
graphics: have some window arguments passed in through cmd args, fix camera pos
Diffstat (limited to 'game')
-rw-r--r--game/Cargo.toml1
-rw-r--r--game/src/main.rs18
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();