Open Pmyl opened 9 months ago
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:
game_loop + winit + latest crates.io version of Pixels
doesn't workgame_loop + winit + latest repository version of Pixels
worksThe 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:
0.13.0
corresponding to the released version on crates.io
.examples/invaders/
to my Desktop (doesn't matter where, just somewhere else outside of the Cargo workspace).Cargo.toml
to point at the crates.io
release.
- pixels = { path = "../.." }
+ pixels = "0.13"
cargo run
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
@Pmyl this should fix it.
- winit = "*"
+ winit = {version="*", features = ["rwh_05"]}
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 thispixels = "0.13.0"
With
{ path = "../.." }
With
"0.13.0"
with the terminal spitting out this error:
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