Comment by MBCook
1 day ago
I wasn’t aware Java had Vulkan bindings. So this is JNI I’m guessing?
This makes sense. I guess I’m a bit surprised they were still OpenGL anywhere.
I never really got into Minecraft though, so I can’t pretend I know much about its current state. I didn’t even realize there was a non-Java version for desktops.
To elaborate on the other comment about the Foreign Function & Memory API: JNI is effectively dead/deprecated, and has been replaced by the aforementioned API. It is orders of magnitude more developer friendly to use. It handles memory much more cleanly. It's way easier to create bindings to talk to foreign functions (e.g. Vulkan).
Probably the most underappreciated great feature in recent Java releases.
It will be a while before JNI itself is dead, because far too much stuff still relies on it. The unsafe helpers in the Java standard library will die first because they are fundamentally incompatible with Valhalla, but it's likely the simple cases will last a while as there are vast swaths of glue code that needs to be rewritten.
IIRC Minecraft is still using entirely JNI and no FFM yet. That will probably start to change in the near future, though. Some modders have already been replacing their own natives with FFM versions.
Hopefully it would use the Foreign Function and Memory API instead of JNI.
I'm pretty sure Mojang will just use the Vulkan bindings provided by LWJGL, considering that Minecraft uses LWJGL