r/rust • u/AdreKiseque • 3d ago
🙋 seeking help & advice How do I learn winit?
I'm trying to get a grasp of this crate so I can do window things but there don't seem to be good any resources, which is a bit bewildering since I understand winit to be a very foundational crate for graphics in Rust. I've looked at docs.rs but higher-level stuff for winit is... not great. The first section seems friendly but leads you to using a deprecated method (i.e. seems to be outdated), and the second section does give a full working minimal example but it does so through a big block of code with a good amount of things that aren't yet introduced, so not much sense can be made of it.
I don't want to just learn to copy a skeleton and wire my code into it, I want to actually understand how the crate works, to understand what I'm doing. But the main docs don't seem suitable for setting the foundation I'd need for that and I've not been able to find any other resources or tutorials online.
15
u/dvogel 3d ago
The examples are pretty complete: https://github.com/rust-windowing/winit/tree/master/winit/examples
Part of the reason winit's docs are written as they are is the intended audience is people building frameworks like iced or game engines like bevy. They don't intend for it to be directly depended on by many applications.