Skip to content

Commit aa035ce

Browse files
committed
fix(Library): Load pojavexec at the right time
Usually LWJGL3 programs would run Library.initialize() to make sure LWJGL is loaded first. We put pojavexec here because it provides methods that modules may need. Currently GLFW and Vulkan modules have methods that are needed by pojavexec, those being `getVulkanDriverHandle()` and `nativeInitializeGLFWNativeBridge()` the latter of which is found used in the Amethyst-Android repository. LWJGL2 programs run through LWJGLX load Sys.initialize() instead so we also add it there for the same reason.
1 parent ee2ed6e commit aa035ce

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

modules/lwjgl/core/src/main/java/org/lwjgl/system/Library.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ public final class Library {
5252
);
5353
}
5454

55+
try {
56+
// pojavexec is used to bridge GLFW with Android/iOS and loading vulkan driver for Android.
57+
System.loadLibrary("pojavexec");
58+
} catch (UnsatisfiedLinkError e) {
59+
e.printStackTrace();
60+
}
5561
loadSystem("org.lwjgl", JNI_LIBRARY_NAME);
5662
}
5763

modules/lwjgl/lwjglx/src/main/java/org/lwjgl/Sys.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@
1212

1313
public class Sys {
1414

15-
/**
16-
* No constructor for Sys.
17-
*/
1815
private Sys() {
16+
try {
17+
// pojavexec is used to bridge GLFW with Android/iOS and loading vulkan driver for Android.
18+
System.loadLibrary("pojavexec");
19+
} catch (UnsatisfiedLinkError e) {
20+
e.printStackTrace();
21+
}
1922
}
2023

2124
/** Returns the LWJGL version. */

0 commit comments

Comments
 (0)