Invaders example doesn't work when using pixels from crates.io
I've spent a very long time trying to debug a problem in my new project, and in the end I've found out that if I target the cloned version on the pixels crate everything works fine!
I can easily replicate the issue in the invaders example by changing this Cargo.toml line
pixels = { path = "../.." }
with this
pixels = "0.13.0"
With { path = "../.." }
With "0.13.0"
with the terminal spitting out this error:
[2024-02-11T15:31:31Z ERROR winit::platform_impl::platform] X11 error: XError {
description: "136",
error_code: 136,
request_code: 148,
minor_code: 1,
}
Edit: I think I've found the commit that fixed the problem, if I rollback just before the commit that updates wgpu to 0.17 then I get the same result as using version 0.13.0, after that commit everything works
System: OS: Pop!_OS 22.04 LTS rustc: 1.74.1
This is probably a duplicate of #313. The examples are permanently tightly coupled to the git repo, and the examples themselves are not published to crates.io.
To use the examples, clone the git repo and run them from there.
I understand that the examples may be out of date, my concern is about the fact that the latest version of Pixels from crates.io doesn't work with "advertised" (by the examples) libraries, but the latest unreleased version of the code does.
Using the Invaders example in this issue was only to speed up the process of demonstrating the problem without having to create a repository example, the main point is:
- using
game_loop + winit + latest crates.io version of Pixelsdoesn't work - using
game_loop + winit + latest repository version of Pixelsworks
The snippet of code that uses game_loop + winit in the Invaders example seems sensible and there is no missing method/trait/etc, everything fits, it just doesn't work
I am not sure what to do, since I cannot reproduce your findings. The steps I took:
- Clone the github repo and checkout tag
0.13.0corresponding to the released version oncrates.io. - Copy
examples/invaders/to my Desktop (doesn't matter where, just somewhere else outside of the Cargo workspace). - Modify
Cargo.tomlto point at thecrates.iorelease.- pixels = { path = "../.." } + pixels = "0.13" -
cargo run - Observe that it works fine (*only tested on Windows)
What am I missing?
I'm on Linux, maybe that's the problem? I'll try again on a different machine and let you know