Closed expensivecake290 closed 4 days ago
Have you tried to look at bgfx bindings? BGFX supports multiple backends including Metal and MoltenVK for MacOS
Hey @expensivecake290,
Technically, it is possible to use Metal using the Objective-C Runtime bindings that LWJGL already provides. However, it would be difficult, ugly and likely slower, because of how the objc_msgSend
family of functions need to be called (often via libffi). Things will get better in LWJGL 4, since Panama has proper support for vararg calls.
In any case though, wrapping Metal into a usable Java API would be a huge undertaking, outside the scope of what LWJGL does. Besides, any application that will want to use Metal directly, would also definitely want to use a number of other Apple APIs. It would be more practical for such an app to implement everything directly (e.g. via Panama) and exactly (the calls it needs and nothing else), rather than wait for a library such as LWJGL to create bindings for entire APIs.
swift-java looks relevant and promising.
Library
metal api
Project page
https://developer.apple.com/metal/
Source repository
No response
Platforms
macOS x64, macOS arm64
Description
hi I was wondering if it was possible to add the metal graphics api to LWJGL3 so many can take advantage of apple silicon to have more fps in many use cases for example Minecraft or any other java application