Page 1 of 1

Vulkan, MoltenVK and Metal fun

Posted: Fri Nov 29, 2019 10:50 pm
by DragonJoker

I've been using wxWidgets for years now, to display the outputs of my 3D engine, and I've based my scene edition tool on wxWidgets.
On Linux and Windows it works perfectly, but now that I own an iMac, I'd like to be able to port my engine on it.

I'm finishing the port of this engine from OpenGL to Vulkan, and MoltenVK is supposed to help in this way (it's an implementation of Vulkan on top of Apple's Metal API).
And here comes my problem : MoltenVK needs a Metal layer, which of course wxWidgets' wxPanel doesn't provide.

So, my question is: is it possible at all on wxWidgets, or will I need some kind of hack, to create this Metal layer ?
I've never had a look at Objective-C, hence I can't tell the feasibility of this.

Has anybody here encountered the same issues ?

Re: Vulkan, MoltenVK and Metal fun

Posted: Sat Nov 30, 2019 8:33 am
by doublemax
I'm pretty sure it's possible, although i can't tell you exactly, how ;)

With Google i found this code snippet: ... -369838674

Under OSX, wxWindow::GetHandle() returns a "NSView *", so it looks like it should be possible to call above code to make it CAMetalLayer compatible.

If you don't get a more useful response here on the form, please ask again on the wx-users Google groups where you can reach the core wx developers (this is a user forum):!forum/wx-users

Re: Vulkan, MoltenVK and Metal fun

Posted: Mon Dec 02, 2019 5:54 pm
by DragonJoker
It works like a charm, thanks for that, I didn't find it in my searches.