diff options
author | Sven Gothel <[email protected]> | 2009-06-03 19:57:05 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-04-19 00:56:21 +0200 |
commit | dd0301a2f37c9810c533b1d3eb7d68ca440d67c8 (patch) | |
tree | fbc02f535451fccf878c5b53bdcba827664adc46 | |
parent | b2a81dc8258720998c7c3a0d524cb7cdf3a60ba5 (diff) |
Tested: - Linux / X11 / GL3 / GL2 / ES1 / ES2 - Using etc/profile.jogl JOGL_ALL . ./setenv-jogl.x86.sh JOGL_ALL - Java2D/GLJPanel: demos.jrefract.JRefract - GLCanvas: demos.gears.Gears - Newt/Nativewindow (demos.GLInfo, demos.es2.RedSquare, demos.es2.RedSquare) - with multiple instances of different GL profiles, ie java demos.es1.RedSquare -GLES2 -GLES1 java demos.GLInfo -GLES2 -GL2 - GL 3.1 test with demos.GLInfo java demos.GLInfo -GL3 java demos.GLInfo -GL3 -GL2 with NVIDIA 180.37.05
JOGL
Enable parallel GLProfiles:
- GL holds it's GLProfile
- GL / GLBase added:
hasGLSL()
getGLProfile()
- Removed all hardcoded GLProfile checks
- Make GLProfile an instance of GLCapabilities
- GLCapabilities needs GLProfile in constructor,
or null for the default GLProfile
- All GLProfiles are singelton mapped objects,
setup and verified at static init.
- All GLDrawableFactories in GLDrawableFactory are singelton objects,
setup at static init.
- GLDrawableFactories.getFactory() needs an argument,
which leads to GLProfile, ie
NativeWindow, AbstractGraphicsConfiguration, GLCapabilities or GLProfile.
- EGLDrawableFactory takes GLProfile as an argument,
being able to take the singleton role as ES1 or ES2
- EGLDrawableFactory loads ES & EGL libraries _local_,
otherwise the symbols produce a collision (Unix/PC-Emulation).
TODO: Check on Windows/WinCE !
- Fixing etc/profile.jogl JOGL_ALL
EGLGraphicsConfigurationFactory
- Added eglGetConfigs -> GLCapabilities -> eglChooseConfig,
in case the simple eglChooseConfig fails.
- Using given chooser, is null, use DefaultGLCapabilitiesChooser
Moved FixedFuncUtil.class -> jogl.util.jar,
otherwise the FixedFuncUtil pipeline cannot be used without emulation.
GLDrawable
Rename getChosenGLCapabilities() -> getGLCapabilities(),
since all GLCapabilities access functions return the current state.
Add getGLProfile()
NativeLibLoader[Base]
Added 'addLoaded' and 'isLoaded', so all LoadAction implementation
can use it and circumvent double library loading.
GlueGen
Split openLibrary -> openLibraryLocal / Global,
utilizing as an optional flag (global), which is true per default.
TODO: How to do this on Windows ?
TODO: Verify Windows and MacOSX !!
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1922 232f8b59-042b-4e1e-8c03-345bb8c30851
-rw-r--r-- | src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java b/src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java index 980f270..aef8a13 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java +++ b/src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java @@ -48,7 +48,7 @@ import java.security.PrivilegedAction; import java.util.HashSet; public class NativeLibLoaderBase { - private static boolean DEBUG = true; + public static final boolean DEBUG = Debug.debug("NativeLibLoader"); public interface LoaderAction { /** @@ -68,24 +68,39 @@ public class NativeLibLoaderBase { boolean preloadIgnoreError) { if (null!=preload) { for (int i=0; i<preload.length; i++) { - try { - System.loadLibrary(preload[i]); - } - catch (UnsatisfiedLinkError e) { - if(DEBUG) e.printStackTrace(); - if (!preloadIgnoreError && e.getMessage().indexOf("already loaded") < 0) { - throw e; - } + if(!isLoaded(preload[i])) { + try { + System.loadLibrary(preload[i]); + addLoaded(preload[i]); + } + catch (UnsatisfiedLinkError e) { + if(DEBUG) e.printStackTrace(); + if (!preloadIgnoreError && e.getMessage().indexOf("already loaded") < 0) { + throw e; + } + } } } } System.loadLibrary(libname); + addLoaded(libname); } } private static final HashSet loaded = new HashSet(); private static LoaderAction loaderAction = new DefaultAction(); + public static boolean isLoaded(String libName) { + return loaded.contains(libName); + } + + public static void addLoaded(String libName) { + loaded.add(libName); + if(DEBUG) { + System.err.println("NativeLibLoaderBase Loaded Native Library: "+libName); + } + } + public static void disableLoading() { setLoadingAction(null); } @@ -100,10 +115,9 @@ public class NativeLibLoaderBase { protected static synchronized void loadLibrary(String libname, String[] preload, boolean preloadIgnoreError) { - if (loaderAction != null && !loaded.contains(libname)) + if (loaderAction != null && !isLoaded(libname)) { loaderAction.loadLibrary(libname, preload, preloadIgnoreError); - loaded.add(libname); } } |