add "--gl" option to set WGPU_BACKEND=gl
This commit is contained in:
parent
8e27525b35
commit
178f6f5d45
21
src/main.rs
21
src/main.rs
|
@ -35,14 +35,19 @@ use std::env;
|
|||
fn main() {
|
||||
let args: Vec<String> = env::args().collect();
|
||||
if args.len() > 1 {
|
||||
if args[1] == "--version" || args[1] == "-v" {
|
||||
let version = option_env!("CARGO_PKG_VERSION").unwrap();
|
||||
let name = option_env!("CARGO_PKG_NAME").unwrap();
|
||||
let homepage = option_env!("CARGO_PKG_HOMEPAGE").unwrap();
|
||||
println!("{name} {version}");
|
||||
println!("License: GNU GPL version 3: https://gnu.org/licenses/gpl.html");
|
||||
println!("{homepage}");
|
||||
return;
|
||||
for arg in &args[1..] {
|
||||
if arg == "--version" || arg == "-v" {
|
||||
let version = option_env!("CARGO_PKG_VERSION").unwrap();
|
||||
let name = option_env!("CARGO_PKG_NAME").unwrap();
|
||||
let homepage = option_env!("CARGO_PKG_HOMEPAGE").unwrap();
|
||||
println!("{name} {version}");
|
||||
println!("License: GNU GPL version 3: https://gnu.org/licenses/gpl.html");
|
||||
println!("{homepage}");
|
||||
return;
|
||||
}
|
||||
else if arg == "--gl" {
|
||||
env::set_var("WGPU_BACKEND", "gl");
|
||||
}
|
||||
}
|
||||
}
|
||||
let mut app = App::new();
|
||||
|
|
Loading…
Reference in a new issue