Skip to content

Commit

Permalink
CLI flag to disable antialiasing
Browse files Browse the repository at this point in the history
  • Loading branch information
agourlay committed Jul 24, 2024
1 parent 04cfb66 commit fa7b248
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Usage: ruxguitar [OPTIONS]

Options:
--sound-font-file <SOUND_FONT_FILE> Optional path to a sound font file
--no-antialiasing Disable antialiasing
-h, --help Print help
-V, --version Print version
```
Expand Down
5 changes: 5 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub fn main_result() -> Result<(), RuxError> {

let args = ApplicationArgs {
sound_font_bank: sound_font_file,
no_antialiasing: args.no_antialiasing,
};

// go!
Expand All @@ -53,11 +54,15 @@ pub struct CliArgs {
/// Optional path to a sound font file.
#[arg(long)]
sound_font_file: Option<String>,
/// Disable antialiasing.
#[arg(long, default_value_t = false)]
no_antialiasing: bool,
}

#[derive(Debug, Clone)]
pub struct ApplicationArgs {
sound_font_bank: Option<PathBuf>,
no_antialiasing: bool,
}

#[derive(Debug, thiserror::Error)]
Expand Down
2 changes: 1 addition & 1 deletion src/ui/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl RuxApplication {
.font(ICONS_FONT)
.window_size((1150.0, 768.0))
.centered()
.antialiasing(true)
.antialiasing(!args.no_antialiasing)
.run_with(move || {
(
RuxApplication::new(args.sound_font_bank.clone()),
Expand Down

0 comments on commit fa7b248

Please sign in to comment.