calculate title at compile time
This commit is contained in:
parent
02bb2d797c
commit
ccce54c1a3
@ -12,6 +12,8 @@ mod model_graphics;
|
||||
mod physics_worker;
|
||||
mod graphics_worker;
|
||||
|
||||
const TITLE:&'static str=concat!("Strafe Client v",env!("CARGO_PKG_VERSION"));
|
||||
|
||||
fn main(){
|
||||
setup::setup_and_start(format!("Strafe Client v{}",env!("CARGO_PKG_VERSION")));
|
||||
setup::setup_and_start(TITLE);
|
||||
}
|
||||
|
@ -192,14 +192,14 @@ pub struct SetupContext<'a>{
|
||||
pub config:wgpu::SurfaceConfiguration,
|
||||
}
|
||||
|
||||
pub fn setup_and_start(title:String){
|
||||
pub fn setup_and_start(title:&str){
|
||||
let event_loop=winit::event_loop::EventLoop::new().unwrap();
|
||||
|
||||
println!("Initializing the surface...");
|
||||
|
||||
let partial_1=create_instance();
|
||||
|
||||
let window=create_window(title.as_str(),&event_loop).unwrap();
|
||||
let window=create_window(title,&event_loop).unwrap();
|
||||
|
||||
let partial_2=partial_1.create_surface(&window).unwrap();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user