diff options
Diffstat (limited to 'src')
9 files changed, 40 insertions, 18 deletions
diff --git a/src/jogl/classes/com/sun/opengl/impl/NativeLibLoader.java b/src/jogl/classes/com/sun/opengl/impl/NativeLibLoader.java index f4425c9df..12dc8fc7d 100644 --- a/src/jogl/classes/com/sun/opengl/impl/NativeLibLoader.java +++ b/src/jogl/classes/com/sun/opengl/impl/NativeLibLoader.java @@ -117,6 +117,9 @@ public class NativeLibLoader extends NativeLibLoaderBase { for (int i=0; i<preload.length; i++) { if(!isLoaded(preload[i])) { try { + if(DEBUG) { + System.err.println("JOGL NativeLibLoader preload "+preload[i]); + } loadLibraryInternal(preload[i]); addLoaded(preload[i]); } @@ -130,6 +133,9 @@ public class NativeLibLoader extends NativeLibLoaderBase { } } + if(DEBUG) { + System.err.println("JOGL NativeLibLoader load "+libname); + } loadLibraryInternal(libname); addLoaded(libname); } diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index c1566ddd0..57f4fb46a 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -658,21 +658,21 @@ public class GLProfile implements Cloneable { } // FIXME: check for real GL3 availability .. ? - hasGL3Impl = hasDesktopGL && null!=NWReflection.getClass("com.sun.opengl.impl.gl3.GL3Impl"); - hasGL2Impl = hasDesktopGL && null!=NWReflection.getClass("com.sun.opengl.impl.gl2.GL2Impl"); + hasGL3Impl = hasDesktopGL && NWReflection.isClassAvailable("com.sun.opengl.impl.gl3.GL3Impl"); + hasGL2Impl = hasDesktopGL && NWReflection.isClassAvailable("com.sun.opengl.impl.gl2.GL2Impl"); - hasGL2ES12Impl = hasDesktopGLES12 && null!=NWReflection.getClass("com.sun.opengl.impl.gl2es12.GL2ES12Impl"); + hasGL2ES12Impl = hasDesktopGLES12 && NWReflection.isClassAvailable("com.sun.opengl.impl.gl2es12.GL2ES12Impl"); boolean btest = false; - boolean hasEGLDynLookup = null!=NWReflection.getClass("com.sun.opengl.impl.egl.EGLDynamicLookupHelper"); + boolean hasEGLDynLookup = NWReflection.isClassAvailable("com.sun.opengl.impl.egl.EGLDynamicLookupHelper"); boolean hasEGLDrawableFactory = false; try { if(hasEGLDynLookup) { hasEGLDrawableFactory = null!=GLDrawableFactory.getFactoryImpl(GLES2); btest = hasEGLDrawableFactory && - null!=NWReflection.getClass("com.sun.opengl.impl.es2.GLES2Impl") && - null!=com.sun.opengl.impl.egl.EGLDynamicLookupHelper.getDynamicLookupHelper(2); + NWReflection.isClassAvailable("com.sun.opengl.impl.es2.GLES2Impl") && + null!=com.sun.opengl.impl.egl.EGLDynamicLookupHelper.getDynamicLookupHelper(2); } } catch (Throwable t) { if (DEBUG) { @@ -686,8 +686,8 @@ public class GLProfile implements Cloneable { try { if(hasEGLDynLookup) { btest = hasEGLDrawableFactory && - null!=NWReflection.getClass("com.sun.opengl.impl.es1.GLES1Impl") && - null!=com.sun.opengl.impl.egl.EGLDynamicLookupHelper.getDynamicLookupHelper(1); + NWReflection.isClassAvailable("com.sun.opengl.impl.es1.GLES1Impl") && + null!=com.sun.opengl.impl.egl.EGLDynamicLookupHelper.getDynamicLookupHelper(1); } } catch (Throwable t) { if (DEBUG) { diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java b/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java index 99c854753..b13cf4317 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java +++ b/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java @@ -50,9 +50,9 @@ public final class NWReflection { return false; } - public static final Class getClass(String clazzName) { + public static final Class getClass(String clazzName, boolean initialize) { try { - return Class.forName(clazzName, false, NWReflection.class.getClassLoader()); + return Class.forName(clazzName, initialize, NWReflection.class.getClassLoader()); } catch (Throwable e) { } return null; } @@ -62,7 +62,7 @@ public final class NWReflection { Constructor factory = null; try { - factoryClass = getClass(clazzName); + factoryClass = getClass(clazzName, true); if (factoryClass == null) { throw new NativeWindowException(clazzName + " not available"); } diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java b/src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java index aef8a139d..e1427d7be 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java +++ b/src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java @@ -72,6 +72,9 @@ public class NativeLibLoaderBase { try { System.loadLibrary(preload[i]); addLoaded(preload[i]); + if(DEBUG) { + System.err.println("NativeLibLoaderBase preloaded "+preload[i]); + } } catch (UnsatisfiedLinkError e) { if(DEBUG) e.printStackTrace(); @@ -84,6 +87,9 @@ public class NativeLibLoaderBase { } System.loadLibrary(libname); addLoaded(libname); + if(DEBUG) { + System.err.println("NativeLibLoaderBase loaded "+libname); + } } } diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTNativeLibLoader.java b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTNativeLibLoader.java index 4b5b57f04..f0f2ac8c3 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTNativeLibLoader.java +++ b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTNativeLibLoader.java @@ -39,7 +39,8 @@ package com.sun.nativewindow.impl.jawt; -import com.sun.nativewindow.impl.*; +import javax.media.nativewindow.NativeWindowFactory; +import com.sun.nativewindow.impl.NativeLibLoaderBase; import java.awt.Toolkit; import java.lang.reflect.InvocationTargetException; @@ -60,10 +61,9 @@ public class JAWTNativeLibLoader extends NativeLibLoaderBase { // ensure references from jogl_awt shared object // will succeed since JAWT shared object isn't in // default library path - boolean isOSX = System.getProperty("os.name").equals("Mac OS X"); - String[] preload = { "jawt" }; - - loadLibrary("nativewindow_awt", (isOSX)?null:preload, false); + if ( ! NativeWindowFactory.TYPE_MACOSX.equals( NativeWindowFactory.getNativeWindowType(false) ) ) { + loadLibrary("jawt", null, true); + } return null; } }); diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTUtil.java b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTUtil.java index ec0794b63..ae606a790 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTUtil.java +++ b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTUtil.java @@ -44,6 +44,7 @@ import java.awt.GraphicsEnvironment; public class JAWTUtil { static { + JAWTNativeLibLoader.loadAWTImpl(); NativeLibLoaderBase.loadNativeWindow("awt"); } diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java index 34fdfbd72..39ec18bc4 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java +++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java @@ -120,7 +120,7 @@ public abstract class NativeWindowFactory { if ( NWReflection.isClassAvailable("java.awt.Component") && NWReflection.isClassAvailable("javax.media.nativewindow.awt.AWTGraphicsDevice") ) { try { - componentClass = NWReflection.getClass("java.awt.Component"); + componentClass = NWReflection.getClass("java.awt.Component", false); } catch (Exception e) { } } diff --git a/src/newt/classes/com/sun/javafx/newt/impl/NativeLibLoader.java b/src/newt/classes/com/sun/javafx/newt/impl/NativeLibLoader.java index b6754c35b..06d76b294 100644 --- a/src/newt/classes/com/sun/javafx/newt/impl/NativeLibLoader.java +++ b/src/newt/classes/com/sun/javafx/newt/impl/NativeLibLoader.java @@ -71,6 +71,9 @@ public class NativeLibLoader extends NativeLibLoaderBase { for (int i=0; i<preload.length; i++) { if(!isLoaded(preload[i])) { try { + if(DEBUG) { + System.err.println("NEWT NativeLibLoader preload "+preload[i]); + } loadLibraryInternal(preload[i]); addLoaded(preload[i]); } @@ -83,6 +86,9 @@ public class NativeLibLoader extends NativeLibLoaderBase { } } + if(DEBUG) { + System.err.println("NEWT NativeLibLoader load "+libname); + } loadLibraryInternal(libname); addLoaded(libname); } @@ -129,6 +135,9 @@ public class NativeLibLoader extends NativeLibLoaderBase { // FIXME: remove // System.out.println("sun.boot.library.path=" + System.getProperty("sun.boot.library.path")); System.loadLibrary(libraryName); + if(DEBUG) { + System.err.println("NEWT NativeLibLoader loaded "+libraryName); + } } } } diff --git a/src/newt/classes/com/sun/javafx/newt/util/MainThread.java b/src/newt/classes/com/sun/javafx/newt/util/MainThread.java index 2ba0a0007..01604476d 100644 --- a/src/newt/classes/com/sun/javafx/newt/util/MainThread.java +++ b/src/newt/classes/com/sun/javafx/newt/util/MainThread.java @@ -114,7 +114,7 @@ public class MainThread { // start user app .. try { - Class mainClass = NWReflection.getClass(mainClassName); + Class mainClass = NWReflection.getClass(mainClassName, true); if(null==mainClass) { throw new RuntimeException(new ClassNotFoundException("MainThread couldn't find main class "+mainClassName)); } |