cd examples
cargo run -p wsg-examples
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user