glium / glium

Safe OpenGL wrapper for the Rust language.
Apache License 2.0
3.48k stars 404 forks source link

Re-export winit #2086

Closed junderw closed 2 months ago

junderw commented 10 months ago

There are a lot of public exposed APIs that accept and return winit types (ie):

https://github.com/glium/glium/blob/1676f0de6dddfa294f834613372f5096a429acd8/src/backend/glutin/mod.rs#L333

Also, most of the tutorials make heavy use of the winit APIs.

Currently this requires users to figure out which version of winit is currently being used, and make sure their winit dependency stays in sync with the glium dependency, otherwise it will be a breaking change if your API expects a 0.29 EventLoop when the user is still using a 0.28 EventLoop.

It seems like you are aware of this, and are bumping semver minor to signify pre-1.0.0 breaking changes whenever you bump the winit dependency to a breaking change.

Since that is already a requirement on your library, you might as well re-export winit explicitly and change the tutorials to recommend using the re-export.

est31 commented 10 months ago

Good point. Before, glutin did this for us, which we already export from the backend::glutin module. From that module, we could also export the winit dependency.

twokilohertz commented 3 months ago

Just ran into this issue myself. Not the hardest thing to diagnose, but still a little bit annoying. An API compatible re-export of the correct version of winit would be nice in the glium crate. :)

Cheers

est31 commented 3 months ago

PRs welcome!

junderw commented 3 months ago

There are tons of examples, so I find & replaced a bit... so let me know what you want to do. But I at least got something started.