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

Example does not support the latest winit #294

Open
Kaifuny opened this issue Nov 2, 2023 · 7 comments
Open

Example does not support the latest winit #294

Kaifuny opened this issue Nov 2, 2023 · 7 comments

Comments

@Kaifuny
Copy link

Kaifuny commented Nov 2, 2023

Example does not support the latest winit

winit = 0.29.0 api has undergone a destructive change. Can't get NSView via window.ns_view(), set MetalView inside window.

I don't know what to do and would like help

@madsmtm
Copy link
Contributor

madsmtm commented Nov 2, 2023

You have to use the raw-window-handle implementation to get the ns_view pointer

@Kaifuny
Copy link
Author

Kaifuny commented Nov 2, 2023

You have to use the raw-window-handle implementation to get the ns_view pointer

I noticed that the logs for the release version of winit have instructions for using raw_window_handle. But I didn't find any example or description of winit with raw_window_handle.

@MarijnS95
Copy link
Contributor

You might want to look at https://github.com/norse-rs/raw-window-metal which takes care of part of the conversion :)

@Rottenfront
Copy link

@Kaifuny, there is an example of using raw window handle 0.6 with latest winit 0.29 by skia-safe

@MarijnS95
Copy link
Contributor

@Rottenfront that link points to the main repo here which is still on Winit 0.27. Did you mean to point to a fork?

@Rottenfront
Copy link

@MarijnS95 oh, I'm sorry, I meant this https://github.com/rust-skia/rust-skia/blob/master/skia-safe/examples/metal-window/main.rs

@MarijnS95
Copy link
Contributor

MarijnS95 commented Jan 7, 2024

Nice, yeah part of that is what raw-window-metal abstracts away for you (though not by using the metal-rs type yet).

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

4 participants