Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metal api #965

Closed
expensivecake290 opened this issue Mar 21, 2024 · 3 comments
Closed

metal api #965

expensivecake290 opened this issue Mar 21, 2024 · 3 comments

Comments

@expensivecake290
Copy link

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

@bonenaut7
Copy link
Contributor

Have you tried to look at bgfx bindings? BGFX supports multiple backends including Metal and MoltenVK for MacOS

@Spasi
Copy link
Member

Spasi commented Sep 25, 2024

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.

@Spasi Spasi closed this as completed Sep 25, 2024
@Spasi
Copy link
Member

Spasi commented Sep 26, 2024

swift-java looks relevant and promising.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants