039f113831
cargo run -p wsg-examples
18 lines
546 B
Rust
18 lines
546 B
Rust
use std::sync::Arc;
|
|
use winit::event_loop::EventLoop;
|
|
use winit::window::WindowBuilder;
|
|
use wsg_lib::context::Context;
|
|
|
|
fn main() {
|
|
let event_loop = EventLoop::new().unwrap();
|
|
let window = Arc::new(WindowBuilder::new().build(&event_loop).unwrap());
|
|
|
|
// Utilisation de pollster pour le bloc async
|
|
let context = pollster::block_on(Context::new(window.clone()));
|
|
|
|
match context {
|
|
Ok(_) => println!("Succès : WGPU context initialisé !"),
|
|
Err(e) => eprintln!("Erreur lors de l'initialisation : {:?}", e),
|
|
}
|
|
}
|