summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-09-02 21:01:10 +0200
committerSven Gothel <[email protected]>2013-09-02 21:01:10 +0200
commit14eab8af439e6e7ce7ee08a9ca13fec3f3a80d25 (patch)
tree0471a459935d36848f6beaec22c4bec5b0ee234b /src
parent275540ba96155277d45b4312888e60b65c372454 (diff)
Fix Bug 810: Adding Julien Gouesse's fix while moved the new 'addNativeJarLibsJoglCfg(..)' to GlueGen, commit c0ead6fa10280f8076704726d59f482b183fd77e
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLProfile.java8
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java30
-rw-r--r--src/newt/classes/jogamp/newt/NEWTJNILibLoader.java32
3 files changed, 28 insertions, 42 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
index 51b822449..e3078271e 100644
--- a/src/jogl/classes/javax/media/opengl/GLProfile.java
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.java
@@ -143,16 +143,12 @@ public class GLProfile {
if(TempJarCache.isInitialized()) {
final ClassLoader cl = GLProfile.class.getClassLoader();
- // either: [jogl-all.jar, jogl-all-noawt.jar, jogl-all-mobile.jar] -> jogl-all-natives-<os.and.arch>.jar
- // or: nativewindow-core.jar -> nativewindow-natives-<os.and.arch>.jar,
- // jogl-core.jar -> jogl-natives-<os.and.arch>.jar,
- // (newt-core.jar -> newt-natives-<os.and.arch>.jar)? (if available)
final String newtFactoryClassName = "com.jogamp.newt.NewtFactory";
final Class<?>[] classesFromJavaJars = new Class<?>[] { NWJNILibLoader.class, GLProfile.class, null };
if( ReflectionUtil.isClassAvailable(newtFactoryClassName, cl) ) {
classesFromJavaJars[2] = ReflectionUtil.getClass(newtFactoryClassName, false, cl);
}
- JNILibLoaderBase.addNativeJarLibs(classesFromJavaJars, "-all", new String[] { "-noawt", "-mobile", "-core" } );
+ JNILibLoaderBase.addNativeJarLibsJoglCfg(classesFromJavaJars);
}
initProfilesForDefaultDevices();
return null;
@@ -170,7 +166,7 @@ public class GLProfile {
}
}
}
-
+
/**
* Trigger eager initialization of GLProfiles for the given device,
* in case it isn't done yet.
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
index 6c15f9a2b..1a106b1b9 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
@@ -36,21 +36,17 @@ import com.jogamp.common.jvm.JNILibLoaderBase;
import com.jogamp.common.os.Platform;
import com.jogamp.common.util.cache.TempJarCache;
-public class NWJNILibLoader extends JNILibLoaderBase {
-
- public static boolean loadNativeWindow(final String ossuffix) {
- return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
- public Boolean run() {
- Platform.initSingleton();
- final String libName = "nativewindow_"+ossuffix ;
- if(TempJarCache.isInitialized() && null == TempJarCache.findLibrary(libName)) {
- // either: [jogl-all.jar, jogl-all-noawt.jar, jogl-all-mobile.jar] -> jogl-all-natives-<os.and.arch>.jar
- // or: nativewindow-core.jar -> nativewindow-natives-<os.and.arch>.jar
- addNativeJarLibs(new Class<?>[] { NWJNILibLoader.class }, "-all", new String[] { "-noawt", "-mobile", "-core" } );
- }
- return new Boolean(loadLibrary(libName, false, NWJNILibLoader.class.getClassLoader()));
- }
- }).booleanValue();
- }
-
+public class NWJNILibLoader extends JNILibLoaderBase {
+ public static boolean loadNativeWindow(final String ossuffix) {
+ return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+ public Boolean run() {
+ Platform.initSingleton();
+ final String libName = "nativewindow_"+ossuffix ;
+ if(TempJarCache.isInitialized() && null == TempJarCache.findLibrary(libName)) {
+ JNILibLoaderBase.addNativeJarLibsJoglCfg(new Class<?>[] { NWJNILibLoader.class });
+ }
+ return Boolean.valueOf(loadLibrary(libName, false, NWJNILibLoader.class.getClassLoader()));
+ }
+ }).booleanValue();
+ }
}
diff --git a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
index bc0eb7531..bc12bf3ee 100644
--- a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
+++ b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
@@ -48,23 +48,17 @@ import com.jogamp.common.jvm.JNILibLoaderBase;
import com.jogamp.common.os.Platform;
import com.jogamp.common.util.cache.TempJarCache;
-public class NEWTJNILibLoader extends JNILibLoaderBase {
-
- public static void loadNEWT() {
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Platform.initSingleton();
- final String libName = "newt";
- if(TempJarCache.isInitialized() && null == TempJarCache.findLibrary(libName)) {
- // either: [jogl-all.jar, jogl-all-noawt.jar, jogl-all-mobile.jar] -> jogl-all-natives-<os.and.arch>.jar
- // or: nativewindow-core.jar -> nativewindow-natives-<os.and.arch>.jar,
- // newt-core.jar -> newt-natives-<os.and.arch>.jar
- JNILibLoaderBase.addNativeJarLibs(new Class<?>[] { NWJNILibLoader.class, NEWTJNILibLoader.class }, "-all", new String[] { "-noawt", "-mobile", "-core" } );
- }
- loadLibrary(libName, false, NEWTJNILibLoader.class.getClassLoader());
- return null;
- }
- });
- }
-
+public class NEWTJNILibLoader extends JNILibLoaderBase {
+ public static boolean loadNEWT() {
+ return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+ public Boolean run() {
+ Platform.initSingleton();
+ final String libName = "newt";
+ if(TempJarCache.isInitialized() && null == TempJarCache.findLibrary(libName)) {
+ JNILibLoaderBase.addNativeJarLibsJoglCfg(new Class<?>[] { NWJNILibLoader.class, NEWTJNILibLoader.class });
+ }
+ return Boolean.valueOf(loadLibrary(libName, false, NEWTJNILibLoader.class.getClassLoader()));
+ }
+ }).booleanValue();
+ }
}