gfx-rs / metal-rs

Rust bindings for Metal
Apache License 2.0
567 stars 112 forks source link

Example does not support the latest winit #294

Open Kaifuny opened 10 months ago

Kaifuny commented 10 months ago

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 commented 10 months ago

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

Kaifuny commented 10 months ago

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 commented 9 months ago

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

Rottenfront commented 8 months ago

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

MarijnS95 commented 8 months ago

@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 commented 8 months ago

@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 commented 8 months ago

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