I'm new in Rust, and I'm trying to build a simple screen to see how to do this in Rust. However, I keep getting the same error when I run the cargo run command. I know it's because I'm using WSL, but I just want to use it this way. I've tried using the WINIT_UNIX_BACKEND=x11 cargo run command, but neither option works..
This is my simple code:
It works for me without setting any environment variables. But that's because I did a lot of work to enable WSLg ages ago. Including installing some drivers:
Optionally, you might also want to upgrade the drivers...
... using the kisak-mesa PPA. But I found that it changes the wgpu GL backend to llvm-pipe (a software rasterizer) on the current Ubuntu version (24.10). The Ubuntu Mesa uses Direct3D 12.
Both Mesa versions are kind of weird. The drop shadow will go totally opaque sometimes, which is quite jarring. I didn't see any behavioral differences with the PPA. Upgrading may not be worthwhile on current version of Ubuntu. But it was crucial on older versions (22.04 and earlier, IIRC).