Files
wsg/examples/main.rs
T
jerome 039f113831 cd examples
cargo run -p wsg-examples
2026-07-03 14:46:59 +02:00

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),
}
}