summaryrefslogtreecommitdiffstats
path: root/src/java/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-09-22 01:40:28 +0200
committerSven Gothel <[email protected]>2011-09-22 01:40:28 +0200
commita258a199da9ba1351d946ad0379c54e8481e931b (patch)
tree496adeadfae80962d5201bd6f22231d985894f1a /src/java/jogamp
parent0a45d6ca9b9a8d92b5e4c147be94fad8de344816 (diff)
gluegen-rt lib loading: Moved to Platform static init incl. TempJarCache.bootstrapNativeLib(..) usage
- Moving to Platform solves former interdependencies between GlueGenJNILibLoader/Platform - TempJarCache is being setup w/ bootstraping the gluegen-rt native lib jar file. Interesting here is that when using Oracle's JRE w/ Applets/JNLP the current dbg output is: gluegen-rt: url-root http://risa/deployment/test/jau02s/jar/ gluegen-rt: nativeJarURL jar:http://risa/deployment/test/jau02s/jar/gluegen-rt-natives-linux-amd64.jar!/ gluegen-rt: nativeJar /home/sven/.java/deployment/cache/6.0/49/3c6d1e31-2c90f42e IE the JRE implementation already deduces the online link to the Applet/JNLP cache. This makes the implementation much simpler, ie. same for application and Applets/JNLP. Have to verify w/ other Java impl. sure - and add same logic for the JOGL part.
Diffstat (limited to 'src/java/jogamp')
-rw-r--r--src/java/jogamp/common/os/MachineDescriptionRuntime.java27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/java/jogamp/common/os/MachineDescriptionRuntime.java b/src/java/jogamp/common/os/MachineDescriptionRuntime.java
index c555724..e7f156f 100644
--- a/src/java/jogamp/common/os/MachineDescriptionRuntime.java
+++ b/src/java/jogamp/common/os/MachineDescriptionRuntime.java
@@ -29,10 +29,8 @@
package jogamp.common.os;
import com.jogamp.common.os.MachineDescription;
-import com.jogamp.common.os.NativeLibrary;
import com.jogamp.common.os.Platform;
import com.jogamp.common.os.MachineDescription.StaticConfig;
-import com.jogamp.gluegen.runtime.GlueGenJNILibLoader;
/**
* Runtime MachineDescription
@@ -53,8 +51,29 @@ public class MachineDescriptionRuntime {
}
return smd;
}
+
+ private static boolean isCPUArch32Bit() throws RuntimeException {
+ switch( Platform.CPU_ARCH ) {
+ case X86_32:
+ case ARM:
+ case ARMv5:
+ case ARMv6:
+ case ARMv7:
+ case SPARC_32:
+ case PPC:
+ return true;
+ case X86_64:
+ case IA64:
+ case SPARCV9_64:
+ case PA_RISC2_0:
+ return false;
+ default:
+ throw new RuntimeException("Please port CPU detection (32/64 bit) to your platform (" + Platform.OS_lower + "/" + Platform.ARCH_lower + "("+Platform.CPU_ARCH+"))");
+ }
+ }
+
private static MachineDescription.StaticConfig getStaticImpl() {
- if(Platform.isCPUArch32Bit()) {
+ if(isCPUArch32Bit()) {
if(Platform.getCPUFamily() == Platform.CPUFamily.ARM && Platform.isLittleEndian()) {
return StaticConfig.ARMle_EABI;
} else if(Platform.getOSType() == Platform.OSType.WINDOWS) {
@@ -85,7 +104,7 @@ public class MachineDescriptionRuntime {
}
private static MachineDescription getRuntimeImpl() {
try {
- GlueGenJNILibLoader.loadGlueGenRT();
+ Platform.initSingleton(); // loads native gluegen-rt library
} catch (UnsatisfiedLinkError err) {
return null;
}