Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Winit 0.28 and skia-safe 0.60.0 #113

Open
everdrone opened this issue Apr 2, 2023 · 3 comments
Open

Winit 0.28 and skia-safe 0.60.0 #113

everdrone opened this issue Apr 2, 2023 · 3 comments

Comments

@everdrone
Copy link

I've been looking forward to using this library as it's extremely useful

Just wanted to know if it's possible to upgrade its dependencies:

Thanks

@aclysma
Copy link
Owner

aclysma commented Apr 3, 2023

I’m not actively using or developing this crate anymore, so it’s unlikely I’m going to find time to do this myself, but it may be as simple as a version bump if you want to try it yourself.

@everdrone
Copy link
Author

everdrone commented Apr 3, 2023

I tried bumping the versions of both and building with: cargo build --workspace --features=winit-28,winit-app
I'm just getting started with Rust but it seems there's a dependency mismatch coming from the included version of rafx implementing a different raw_window_handle

error[E0277]: the trait bound `Window: raw_window_handle::HasRawWindowHandle` is not satisfied
    --> skulpin-app-winit\src\app.rs:234:54
     |
234  |         let renderer_result = renderer_builder.build(&window, window_extents);
     |                                                      ^^^^^^^ the trait `raw_window_handle::HasRawWindowHandle` is not implemented for `Window`
     |
help: trait impl with same name found
    --> C:\Users\Giorgio\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.28.3\src\window.rs:1327:1
     |
1327 | unsafe impl HasRawWindowHandle for Window {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `raw_window_handle` are being used?
     = help: the trait `raw_window_handle::HasRawWindowHandle` is implemented for `&'a T`
     = note: required for `Window` to implement `HasRawWindowHandle`
     = note: required for the cast from `Window` to the object type `dyn HasRawWindowHandle`

Can I ask you for some guidance on how to proceed?

EDIT: commit link

@aclysma
Copy link
Owner

aclysma commented Apr 3, 2023

You're very much on the right track, I'm sorry the project didn't build and run right away.

Personally if you're just wanting to play around, I think the path of least resistance would be to use winit 0.25.

Otherwise, you need to update dependencies like rafx to use raw-window-handle 0.5. This probably won't be difficult, but it may be more than you care to do right now. If such a change were committed to rafx, it might break other things that are downstream from it that I work on/use such as imgui integration. I'm not necessarily rushing into doing that because frankly, I have other things to do than chase winit/raw-window-handle versions. (I have half a mind to transition over to SDL2 because it would probably break less often, and it's shipped in many real products, so IMO it's a more mature solution.)

It might also be possible to use both raw-window-handle 0.5 and 0.3, and copy the values from a 0.5 version of the struct to a 0.3 version of the struct. This would hopefully limit the chain of dependencies that need to be modified to use raw-window-handle 0.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants