Replies: 1 comment
|
Metal can be accessed via LWJGL3's macOS stuff, though it doesn't serve as bindings to Metal since it's a "figure it out yourself" interface to the Objective-C runtime. Mojang is far better off switching to Vulkan for its graphics API than adding a Metal option, since Vulkan is supported natively via a Metal bridge that LWJGL provides out-of-the-box. If you want to do this yourself, you would start with something like the code snippet below: SharedLibrary objc = ObjCRuntime.getLibrary(); // retrieves the 'shared library' object
long msgSend = objc.getFunctionAddress("objc_msgSend"); // gets the function pointer to the (ObjC) runtime's msgSend function
SharedLibrary mtk = MacOSXLibrary.create("/System/Library/Frameworks/MetalKit.framework");
SharedLibrary lib = MacOSXLibrary.create("/System/Library/Frameworks/Metal.framework");Those should be everything one would need to work with Metal using Java. Though again, you'd need to know Objective-C, the Objective-C Runtime, and Metal. Not impossible, but not everything is evident. lwjgl3-awt has some example code if you need it for reference, which includes annotations for what its doing and its Objective-C analogue. |
Uh oh!
There was an error while loading. Please reload this page.
Following the announcement of Metal 3, will this have much impact on the bindings on macOS? Are there any plans around this?
BTW I became aware of Metal 3, because of a feature request for Minecraft.
All reactions