diff --git a/build.xml b/build.xml index 07bec5d7..913af555 100644 --- a/build.xml +++ b/build.xml @@ -358,14 +358,14 @@ - + - + @@ -388,12 +388,12 @@ - + - + diff --git a/platform_build/linux_ant/build.xml b/platform_build/linux_ant/build.xml index 7dddb745..84f705d5 100644 --- a/platform_build/linux_ant/build.xml +++ b/platform_build/linux_ant/build.xml @@ -2,7 +2,8 @@ - + + @@ -21,6 +22,9 @@ + + + diff --git a/src/java/org/lwjgl/DefaultSysImplementation.java b/src/java/org/lwjgl/DefaultSysImplementation.java index 313eb777..dd8d200f 100644 --- a/src/java/org/lwjgl/DefaultSysImplementation.java +++ b/src/java/org/lwjgl/DefaultSysImplementation.java @@ -46,6 +46,10 @@ abstract class DefaultSysImplementation implements SysImplementation { return 1000; } + public boolean has64Bit() { + return false; + } + public abstract long getTime(); public abstract void alert(String title, String message); public abstract String getClipboard(); diff --git a/src/java/org/lwjgl/LWJGLUtil.java b/src/java/org/lwjgl/LWJGLUtil.java index e64a01e8..933b9168 100644 --- a/src/java/org/lwjgl/LWJGLUtil.java +++ b/src/java/org/lwjgl/LWJGLUtil.java @@ -58,7 +58,7 @@ public class LWJGLUtil { public static final int PLATFORM_WINDOWS = 3; public static final String PLATFORM_LINUX_NAME = "linux"; public static final String PLATFORM_MACOSX_NAME = "macosx"; - public static final String PLATFORM_WINDOWS_NAME = "win32"; + public static final String PLATFORM_WINDOWS_NAME = "windows"; /** LWJGL Logo - 16 by 16 pixels */ public static final ByteBuffer LWJGLIcon16x16 = BufferUtils.createByteBuffer(16 * 16 * 4).put(new byte[] { diff --git a/src/java/org/lwjgl/LinuxSysImplementation.java b/src/java/org/lwjgl/LinuxSysImplementation.java index 41139b29..d4e1c2c7 100644 --- a/src/java/org/lwjgl/LinuxSysImplementation.java +++ b/src/java/org/lwjgl/LinuxSysImplementation.java @@ -71,4 +71,8 @@ class LinuxSysImplementation extends J2SESysImplementation { // Seems to have failed return false; } + + public boolean has64Bit() { + return true; + } } diff --git a/src/java/org/lwjgl/Sys.java b/src/java/org/lwjgl/Sys.java index 3e86dc0d..644e266c 100644 --- a/src/java/org/lwjgl/Sys.java +++ b/src/java/org/lwjgl/Sys.java @@ -58,8 +58,10 @@ public final class Sys { /** The implementation instance to delegate platform specific behavior to */ private final static SysImplementation implementation; + + private final static String POSTFIX64BIT = "64"; - private static void loadLibrary(final String lib_name) { + private static void doLoadLibrary(final String lib_name) { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { String library_path = System.getProperty("org.lwjgl.librarypath"); @@ -72,6 +74,21 @@ public final class Sys { return null; } }); + } + + private static void loadLibrary(final String lib_name) { + try { + loadLibrary(lib_name); + } catch (UnsatisfiedLinkError e) { + if (implementation.has64Bit()) { + try { + loadLibrary(lib_name + POSTFIX64BIT); + } catch (UnsatisfiedLinkError e2) { + LWJGLUtil.log("Failed to load 64 bit library:" + e2.getMessage()); + } + } + throw e; + } } static { diff --git a/src/java/org/lwjgl/SysImplementation.java b/src/java/org/lwjgl/SysImplementation.java index f7d9344a..f7c9e7d3 100644 --- a/src/java/org/lwjgl/SysImplementation.java +++ b/src/java/org/lwjgl/SysImplementation.java @@ -44,22 +44,28 @@ interface SysImplementation { /** * Return the version of the native library */ - public String getNativeLibraryVersion(); + String getNativeLibraryVersion(); - public void setDebug(boolean debug); + void setDebug(boolean debug); /** * Obtains the number of ticks that the hires timer does in a second. * * @return timer resolution in ticks per second or 0 if no timer is present. */ - public long getTimerResolution(); + long getTimerResolution(); - public long getTime(); + long getTime(); - public void alert(String title, String message); + void alert(String title, String message); boolean openURL(String url); - public String getClipboard(); + String getClipboard(); + + /** + * Returns true there exists a separate 64 bit library + * on the platform + */ + boolean has64Bit(); } diff --git a/src/java/org/lwjgl/util/applet/LWJGLInstaller.java b/src/java/org/lwjgl/util/applet/LWJGLInstaller.java index 3aed3a4f..49be2e36 100644 --- a/src/java/org/lwjgl/util/applet/LWJGLInstaller.java +++ b/src/java/org/lwjgl/util/applet/LWJGLInstaller.java @@ -84,7 +84,7 @@ public class LWJGLInstaller { * the user's temp directory, and instruct the LWJGL subsystem to load its * native files from there. * The file required by the installer, is gotten from the classloader via its - * getResource command, and is expected to be named _natives.jar. + * getResource command, and is expected to be named _natives.jar. * Note: Due to the nature of native libraries, we cannot actually uninstall the currently * loaded files, but rather the "last" installed. This means that the most recent install of LWJGL * will always be present in the users temp dir. When invoking the tempInstall method, all old installations