Skip to content

Commit 73926d5

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 fe86505 commit 73926d5

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
@@ -55,6 +55,12 @@ public final class Library {
5555
);
5656
}
5757

58+
try {
59+
// pojavexec is used to bridge GLFW with Android/iOS and loading vulkan driver for Android.
60+
System.loadLibrary("pojavexec");
61+
} catch (UnsatisfiedLinkError e) {
62+
e.printStackTrace();
63+
}
5864
loadSystem("org.lwjgl", JNI_LIBRARY_NAME);
5965
}
6066

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

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

1212
public class Sys {
1313

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

2023
/** Returns the LWJGL version. */

0 commit comments

Comments
 (0)