core-foundation-rs icon indicating copy to clipboard operation
core-foundation-rs copied to clipboard

Support for CAMetalLayer in NSView?

Open hobogenized opened this issue 6 years ago • 2 comments

I'm trying to figure out if setLayer as it is in AppKit supports setting a CAMetalLayer for an NSView.

The example I'm following is as follows: https://github.com/KhronosGroup/MoltenVK/issues/78

I'm trying to get this to work to get MoltenVK working without resorting to writing ObjectiveC.

hobogenized avatar Jul 03 '18 21:07 hobogenized

I believe this should work.

jrmuizel avatar Jul 06 '18 18:07 jrmuizel

Thanks for the response.

The approach described in the link I provided seems to instantiate a CAMetalLayer, but the setLayer method in AppKit.rs takes in an integer as a parameter. It doesn't help that the official Apple documents don't seem to document the setLayer method: https://developer.apple.com/documentation/uikit/uiview/1622436-layer

Do you have any suggestions as to how to approach it from this end? Should there be defined constants to be used in this API?

hobogenized avatar Jul 10 '18 19:07 hobogenized