Replies: 2 comments 2 replies
-
I find the Metal-CPP project useful for that. https://developer.apple.com/metal/cpp/ the learn examples have window/view creation without any Objective C: https://developer.apple.com/metal/sample-code/ "Learn Metal with C++" You are welcome to look at my own MoltenVk draw a triangle on screen project which does its own simplistic Window/View handling. https://github.com/Zorro666/VulkanTriangle |
Beta Was this translation helpful? Give feedback.
-
I think for resize events you need to add a delegate to the window. Something like this in objective-c
and associate it with the window
The Cube example in MoltenVk has resize handling code but does not have it hooked up on Mac to the resize event. Another way I have seen it done is at the start of your render method get the size of the |
Beta Was this translation helpful? Give feedback.
-
Is there any chance of an example of creating a window completely in code using NSWindow/ViewController etc, without using a storyboard? The reason I ask is because I have an easily reproducible bug where when resizing my swap chain due to a window resize, the swap chain can get into a state where it shows a corrupt image for every 2nd swap. The only debugging information I can get so far is a print from Xcode saying 'GPU Soft Fault count: 1'.
It would be great to get a gut-check example doing all-code setup to ensure my relationships between the view/layer/surface and swap chains are all correct.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions