From c75785dcc4758b3d865c5ccf6677389ab112d2fb Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 31 Aug 2011 03:25:48 +0200 Subject: DynamicLibraryBundle*: Use generics for better spec - following gluegen commit cfb9e118e020707842e6b5136b07f5ab149540c1 --- .../opengl/cg/CgDynamicLibraryBundleInfo.java | 24 +++++++----- .../opengl/DesktopGLDynamicLibraryBundleInfo.java | 6 +-- .../jogamp/opengl/GLDynamicLibraryBundleInfo.java | 6 +-- .../opengl/egl/EGLDynamicLibraryBundleInfo.java | 18 ++++----- .../opengl/egl/EGLES1DynamicLibraryBundleInfo.java | 44 ++++++++++++---------- .../opengl/egl/EGLES2DynamicLibraryBundleInfo.java | 43 +++++++++++---------- .../cgl/MacOSXCGLDynamicLibraryBundleInfo.java | 27 +++++-------- .../wgl/WindowsWGLDynamicLibraryBundleInfo.java | 19 +++++----- .../x11/glx/X11GLXDynamicLibraryBundleInfo.java | 30 +++++++-------- 9 files changed, 108 insertions(+), 109 deletions(-) (limited to 'src/jogl') diff --git a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java index 08c755cd3..9e4d76869 100644 --- a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java +++ b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java @@ -32,9 +32,9 @@ import com.jogamp.common.os.DynamicLibraryBundleInfo; import java.util.*; public class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { - private static List/**/ glueLibNames; + private static List glueLibNames; static { - glueLibNames = new ArrayList(); + glueLibNames = new ArrayList(); // glueLibNames.addAll(getGlueLibNamesPreload()); glueLibNames.add("jogl_cg"); } @@ -54,7 +54,7 @@ public class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { public boolean shallLookupGlobal() { return false; } /** Tool has none **/ - public final List getToolGetProcAddressFuncNameList() { + public final List getToolGetProcAddressFuncNameList() { return null; } @@ -67,16 +67,20 @@ public class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { return false; } - public List/*>*/ getToolLibNames() { - List/**/ libNamesList = new ArrayList(); + public List> getToolLibNames() { + final List> libsList = new ArrayList>(); + final List libsCg = new ArrayList(); + libsCg.add("Cg"); + libsList.add(libsCg); + + final List libsCgGL = new ArrayList(); + libsCgGL.add("CgGL"); + libsList.add(libsCgGL); - libNamesList.add("Cg"); - libNamesList.add("CgGL"); - - return libNamesList; + return libsList; } - public final List/**/ getGlueLibNames() { + public final List getGlueLibNames() { return glueLibNames; } } diff --git a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java index 1b8c3c1e5..c0a75da23 100644 --- a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java +++ b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java @@ -32,9 +32,9 @@ import java.util.List; import java.util.ArrayList; public abstract class DesktopGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundleInfo { - private static List/**/ glueLibNames; + private static List glueLibNames; static { - glueLibNames = new ArrayList(); + glueLibNames = new ArrayList(); glueLibNames.addAll(getGlueLibNamesPreload()); glueLibNames.add("jogl_desktop"); @@ -44,7 +44,7 @@ public abstract class DesktopGLDynamicLibraryBundleInfo extends GLDynamicLibrary super(); } - public final List/**/ getGlueLibNames() { + public final List getGlueLibNames() { return glueLibNames; } diff --git a/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java index bedf431f5..433484162 100644 --- a/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java +++ b/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java @@ -32,9 +32,9 @@ import com.jogamp.common.os.DynamicLibraryBundleInfo; import java.util.*; public abstract class GLDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { - static List/**/ glueLibNamesPreload; + static List glueLibNamesPreload; static { - glueLibNamesPreload = new ArrayList(); + glueLibNamesPreload = new ArrayList(); glueLibNamesPreload.add("nativewindow_x11"); } @@ -47,7 +47,7 @@ public abstract class GLDynamicLibraryBundleInfo implements DynamicLibraryBundle /** default **/ public boolean shallLookupGlobal() { return false; } - public static List/**/ getGlueLibNamesPreload() { + public static List getGlueLibNamesPreload() { return glueLibNamesPreload; } } diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java index 137599650..33154b089 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java @@ -48,9 +48,9 @@ import java.security.*; * Currently two implementations exist, one for ES1 and one for ES2. */ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundleInfo { - static List/**/ glueLibNames; + static List glueLibNames; static { - glueLibNames = new ArrayList(); + glueLibNames = new ArrayList(); glueLibNames.addAll(GLDynamicLibraryBundleInfo.getGlueLibNamesPreload()); glueLibNames.add("jogl_mobile"); } @@ -71,8 +71,8 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle return false; } - public final List getToolGetProcAddressFuncNameList() { - List res = new ArrayList(); + public final List getToolGetProcAddressFuncNameList() { + List res = new ArrayList(); res.add("eglGetProcAddress"); return res; } @@ -85,21 +85,21 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle return false; // JAU / FIXME funcName.startsWith("egl"); } - protected List/**/ getEGLLibNamesList() { - List/**/ eglLibNames = new ArrayList(); + protected List getEGLLibNamesList() { + List eglLibNames = new ArrayList(); // try default generic names first - eglLibNames.add("EGL"); - + eglLibNames.add("EGL"); // for windows distributions using the 'unlike' lib prefix, // where our tool does not add it. eglLibNames.add("libEGL"); // this is the default EGL lib name, according to the spec eglLibNames.add("libEGL.so.1"); + return eglLibNames; } - public final List/**/ getGlueLibNames() { + public final List getGlueLibNames() { return glueLibNames; } } diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java index 4c38a29b1..e96e79ee2 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java @@ -39,26 +39,30 @@ public class EGLES1DynamicLibraryBundleInfo extends EGLDynamicLibraryBundleInfo super(); } - public List getToolLibNames() { - List/**/ libNames = new ArrayList(); - - List/**/ glesLibNames = new ArrayList(); + public List> getToolLibNames() { + final List> libsList = new ArrayList>(); + { + final List libsGL = new ArrayList(); + + // try default generic names first + libsGL.add("GLES_CM"); + libsGL.add("GLES_CL"); + libsGL.add("GLESv1_CM"); + + // for windows distributions using the 'unlike' lib prefix, + // where our tool does not add it. + libsGL.add("libGLES_CM"); + libsGL.add("libGLES_CL"); + libsGL.add("libGLESv1_CM"); + + // this is the default lib name, according to the spec + libsGL.add("libGLESv1_CM.so.1"); + + libsList.add(libsGL); + } + libsList.add(getEGLLibNamesList()); - // try default generic names first - glesLibNames.add("GLES_CM"); - glesLibNames.add("GLES_CL"); - glesLibNames.add("GLESv1_CM"); - // for windows distributions using the 'unlike' lib prefix, - // where our tool does not add it. - glesLibNames.add("libGLES_CM"); - glesLibNames.add("libGLES_CL"); - glesLibNames.add("libGLESv1_CM"); - // this is the default lib name, according to the spec - glesLibNames.add("libGLESv1_CM.so.1"); - - libNames.add(glesLibNames); - libNames.add(getEGLLibNamesList()); - return libNames; - } + return libsList; + } } diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java index 7943e1946..ac6d76220 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java @@ -39,26 +39,29 @@ public class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundleInfo super(); } - public List getToolLibNames() { - List/**/ libNames = new ArrayList(); - - List/**/ glesLibNames = new ArrayList(); - - // try default generic names first - glesLibNames.add("GLES20"); - glesLibNames.add("GLESv2"); - glesLibNames.add("GLESv2_CM"); - // for windows distributions using the 'unlike' lib prefix - // where our tool does not add it. - glesLibNames.add("libGLES20"); - glesLibNames.add("libGLESv2"); - glesLibNames.add("libGLESv2_CM"); - // this is the default lib name, according to the spec - glesLibNames.add("libGLESv2.so.2"); + public List> getToolLibNames() { + final List> libsList = new ArrayList>(); + { + final List libsGL = new ArrayList(); + + // try default generic names first + libsGL.add("GLES20"); + libsGL.add("GLESv2"); + libsGL.add("GLESv2_CM"); + // for windows distributions using the 'unlike' lib prefix + // where our tool does not add it. + libsGL.add("libGLES20"); + libsGL.add("libGLESv2"); + libsGL.add("libGLESv2_CM"); + // this is the default lib name, according to the spec + libsGL.add("libGLESv2.so.2"); + + libsList.add(libsGL); + } + libsList.add(getEGLLibNamesList()); - libNames.add(glesLibNames); - libNames.add(getEGLLibNamesList()); - return libNames; - } + return libsList; + } + } diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java index e81a9f4c5..a5d3579bc 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java @@ -29,32 +29,23 @@ package jogamp.opengl.macosx.cgl; import jogamp.opengl.*; -import com.jogamp.common.os.DynamicLookupHelper; -import com.jogamp.common.os.NativeLibrary; -import com.jogamp.common.os.Platform; import java.util.*; -import java.security.*; -import javax.media.opengl.GLException; public class MacOSXCGLDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo { protected MacOSXCGLDynamicLibraryBundleInfo() { super(); } - public List getToolLibNames() { - List/**/ libNamesList = new ArrayList(); - - List/**/ glesLibNames = new ArrayList(); - - glesLibNames.add("/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib"); - glesLibNames.add("GL"); - - libNamesList.add(glesLibNames); - - return libNamesList; + public List> getToolLibNames() { + final List> libsList = new ArrayList>(); + final List libsGL = new ArrayList(); + libsGL.add("/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib"); + libsGL.add("GL"); + libsList.add(libsGL); + return libsList; } - - public final List getToolGetProcAddressFuncNameList() { + + public final List getToolGetProcAddressFuncNameList() { return null; /** OSX manual says: NSImage use is discouraged List res = new ArrayList(); diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java index c7feb83c7..ea7dc81ec 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java @@ -36,17 +36,16 @@ public class WindowsWGLDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryB super(); } - public List getToolLibNames() { - List/**/ libNamesList = new ArrayList(); - - libNamesList.add("OpenGL32"); - - return libNamesList; + public List> getToolLibNames() { + final List> libsList = new ArrayList>(); + final List libsGL = new ArrayList(); + libsGL.add("OpenGL32"); + libsList.add(libsGL); + return libsList; } - - - public final List getToolGetProcAddressFuncNameList() { - List res = new ArrayList(); + + public final List getToolGetProcAddressFuncNameList() { + List res = new ArrayList(); res.add("wglGetProcAddress"); return res; } diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java index aa6e3e849..eb6c17cf6 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java @@ -36,11 +36,10 @@ public class X11GLXDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundl super(); } - public List getToolLibNames() { - List/**/ libNamesList = new ArrayList(); - - List/**/ glLibNames = new ArrayList(); - + public List> getToolLibNames() { + final List> libsList = new ArrayList>(); + final List libsGL = new ArrayList(); + // Be aware that on DRI systems, eg ATI fglrx, etc, // you have to set LIBGL_DRIVERS_PATH env variable. // Eg on Ubuntu 64bit systems this is: @@ -48,19 +47,18 @@ public class X11GLXDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundl // // this is the default lib name, according to the spec - glLibNames.add("libGL.so.1"); + libsGL.add("libGL.so.1"); // try this one as well, if spec fails - glLibNames.add("libGL.so"); + libsGL.add("libGL.so"); // last but not least .. the generic one - glLibNames.add("GL"); - - libNamesList.add(glLibNames); - - return libNamesList; - } - + libsGL.add("GL"); + + libsList.add(libsGL); + return libsList; + } + /** * This respects old DRI requirements:
*
@@ -69,8 +67,8 @@ public class X11GLXDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundl
      */
     public boolean shallLinkGlobal() { return true; }
 
-    public final List getToolGetProcAddressFuncNameList() {
-        List res = new ArrayList();
+    public final List getToolGetProcAddressFuncNameList() {
+        List res = new ArrayList();
         res.add("glXGetProcAddressARB");
         res.add("glXGetProcAddress");
         return res;
-- 
cgit v1.2.3