Depend on glfw::WindowEvent or glfw
- Dominant language
- Rust
- Stars
- 1.8k
- Forks
- 194
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 2
Description
Right now, if you were to try and make `examples/camera.rs` into its own crate, you run into a dependency problem. `camera.rs` includes the line `use glfw`, which means that if it were in its own crate, it would need to depend on `kiss3d` _and_ `glfw`. But not just any `glfw`: if you just put `glfw = "*"` in the `Cargo.toml` dependencies, you get a cryptic error `expected enum 'glfw::WindowEvent',
found a different enum 'glfw::WindowEvent')`.
This happens because one version of `glfw` is built for `kiss3d` based on `git:[..]bjz/glfw-rs` with default features turned off, and one version based on the `crates.io` glfw-rs version with default features turned on. Instead, you need to copy and paste the same `glfw` dependency from the `kiss3d` `Cargo.toml` section.
This is pretty confusing, and would be greatly simplified if `kiss3d` simply exported its reference to `glfw::WindowEvent` (i.e. `pub use glfw::WindowEvent`), or (if there are other instances like this, and you don't want to handle them specifically) its reference to `glfw`. See [this post](https://users.rust-lang.org/t/cargo-how-do-i-use-the-dependency-of-a-dependency/1627) for more details; after thinking about it, I think the right solution is for `kiss3d` to export `glfw` symbols.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with examples/camera.rs and the glfw dependency section in Cargo.toml. Check how the example imports WindowEvent and how kiss3d exposes its glfw dependency. Done means the example can be made into a separate crate while using kiss3d's glfw symbols without requiring a conflicting direct glfw dependency.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100