|
|
|
@ -144,8 +144,22 @@ public final class NativeLibraryLoader { |
|
|
|
|
registerNativeLibrary("lwjgl3", Platform.Linux64, "native/linux/liblwjgl.so"); |
|
|
|
|
registerNativeLibrary("lwjgl3", Platform.MacOSX32, "native/macosx/liblwjgl.dylib"); |
|
|
|
|
registerNativeLibrary("lwjgl3", Platform.MacOSX64, "native/macosx/liblwjgl.dylib"); |
|
|
|
|
//registerNativeLibrary("lwjgl3", Platform.Windows32, "native/windows/jemalloc32.dll"); // These are introduced in LWJGL 3.0.0b
|
|
|
|
|
//registerNativeLibrary("lwjgl3", Platform.Windows64, "native/windows/jemalloc.dll"); // These are introduced in LWJGL 3.0.0b
|
|
|
|
|
|
|
|
|
|
// GLFW for LWJGL 3.x
|
|
|
|
|
registerNativeLibrary("glfw-lwjgl3", Platform.Windows32, "native/windows/glfw32.dll"); |
|
|
|
|
registerNativeLibrary("glfw-lwjgl3", Platform.Windows64, "native/windows/glfw.dll"); |
|
|
|
|
registerNativeLibrary("glfw-lwjgl3", Platform.Linux32, "native/linux/libglfw32.so"); |
|
|
|
|
registerNativeLibrary("glfw-lwjgl3", Platform.Linux64, "native/linux/libglfw.dll"); |
|
|
|
|
registerNativeLibrary("glfw-lwjgl3", Platform.MacOSX32, "native/macosx/libglfw.dylib"); |
|
|
|
|
registerNativeLibrary("glfw-lwjgl3", Platform.MacOSX64, "native/macosx/libglfw.dylib"); |
|
|
|
|
|
|
|
|
|
// jemalloc for LWJGL 3.x
|
|
|
|
|
registerNativeLibrary("jemalloc-lwjgl3", Platform.Windows32, "native/windows/jemalloc32.dll"); |
|
|
|
|
registerNativeLibrary("jemalloc-lwjgl3", Platform.Windows64, "native/windows/jemalloc.dll"); |
|
|
|
|
registerNativeLibrary("jemalloc-lwjgl3", Platform.Linux32, "native/linux/libjemalloc32.so"); |
|
|
|
|
registerNativeLibrary("jemalloc-lwjgl3", Platform.Linux64, "native/linux/libjemalloc.so"); |
|
|
|
|
registerNativeLibrary("jemalloc-lwjgl3", Platform.MacOSX32, "native/macosx/libjemalloc.dylib"); |
|
|
|
|
registerNativeLibrary("jemalloc-lwjgl3", Platform.MacOSX64, "native/macosx/libjemalloc.dylib"); |
|
|
|
|
|
|
|
|
|
// OpenAL for LWJGL 3.x
|
|
|
|
|
// For OSX: Need to add lib prefix when extracting
|
|
|
|
@ -475,7 +489,7 @@ public final class NativeLibraryLoader { |
|
|
|
|
if (url == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String loadedAsFileName; |
|
|
|
|
if (library.getExtractedAsName() != null) { |
|
|
|
|
loadedAsFileName = library.getExtractedAsName(); |
|
|
|
@ -522,7 +536,7 @@ public final class NativeLibraryLoader { |
|
|
|
|
throw new UnsupportedOperationException("JVM is running under " |
|
|
|
|
+ "reduced permissions. Cannot load native libraries."); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Platform platform = JmeSystem.getPlatform(); |
|
|
|
|
NativeLibrary library = nativeLibraryMap.get(new NativeLibrary.Key(name, platform)); |
|
|
|
|
|
|
|
|
@ -540,27 +554,28 @@ public final class NativeLibraryLoader { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String pathInJar = library.getPathInNativesJar(); |
|
|
|
|
|
|
|
|
|
final String pathInJar = library.getPathInNativesJar(); |
|
|
|
|
|
|
|
|
|
if (pathInJar == null) { |
|
|
|
|
// This platform does not require the native library to be loaded.
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String fileNameInJar; |
|
|
|
|
final String fileNameInJar; |
|
|
|
|
|
|
|
|
|
if (pathInJar.contains("/")) { |
|
|
|
|
fileNameInJar = pathInJar.substring(pathInJar.lastIndexOf("/") + 1); |
|
|
|
|
} else { |
|
|
|
|
fileNameInJar = pathInJar; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
URL url = Thread.currentThread().getContextClassLoader().getResource(pathInJar); |
|
|
|
|
|
|
|
|
|
if (url == null) { |
|
|
|
|
// Try the root of the classpath as well.
|
|
|
|
|
url = Thread.currentThread().getContextClassLoader().getResource(fileNameInJar); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (url == null) { |
|
|
|
|
// Attempt to load it as a system library.
|
|
|
|
|
String unmappedName = unmapLibraryName(fileNameInJar); |
|
|
|
|