diff options
author | Sven Gothel <[email protected]> | 2008-06-25 05:50:55 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2008-06-25 05:50:55 +0000 |
commit | b02adebb3213e19aecfe84e6966e52976e5c09cf (patch) | |
tree | 6435fdac5e3ccad90ae1e96b684e56d79fb57bcf /src | |
parent | 800c7da4656277810d579e76b74558434bb6467c (diff) |
Native Compilation: Partitioning and X11 clean
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1680 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src')
15 files changed, 46 insertions, 14 deletions
diff --git a/src/classes/com/sun/javafx/newt/windows/WindowsWindow.java b/src/classes/com/sun/javafx/newt/windows/WindowsWindow.java index eda64cc20..7393326d3 100755 --- a/src/classes/com/sun/javafx/newt/windows/WindowsWindow.java +++ b/src/classes/com/sun/javafx/newt/windows/WindowsWindow.java @@ -40,7 +40,7 @@ public class WindowsWindow extends Window { private static final String WINDOW_CLASS_NAME = "NewtWindow"; static { - NativeLibLoader.loadCore(); + NativeLibLoader.loadNEWT(); if (!initIDs()) { throw new RuntimeException("Failed to initialize jmethodIDs"); diff --git a/src/classes/com/sun/javafx/newt/x11/X11Display.java b/src/classes/com/sun/javafx/newt/x11/X11Display.java index 00df325c6..7f921739b 100755 --- a/src/classes/com/sun/javafx/newt/x11/X11Display.java +++ b/src/classes/com/sun/javafx/newt/x11/X11Display.java @@ -38,7 +38,7 @@ import com.sun.opengl.impl.*; public class X11Display extends Display { static { - NativeLibLoader.loadCore(); + NativeLibLoader.loadNEWT(); } public X11Display() { diff --git a/src/classes/com/sun/javafx/newt/x11/X11Screen.java b/src/classes/com/sun/javafx/newt/x11/X11Screen.java index 4094c557c..5920d4997 100755 --- a/src/classes/com/sun/javafx/newt/x11/X11Screen.java +++ b/src/classes/com/sun/javafx/newt/x11/X11Screen.java @@ -38,7 +38,7 @@ import com.sun.opengl.impl.*; public class X11Screen extends Screen { static { - NativeLibLoader.loadCore(); + NativeLibLoader.loadNEWT(); } public X11Screen() { diff --git a/src/classes/com/sun/javafx/newt/x11/X11Window.java b/src/classes/com/sun/javafx/newt/x11/X11Window.java index 63e558bbc..299b78429 100755 --- a/src/classes/com/sun/javafx/newt/x11/X11Window.java +++ b/src/classes/com/sun/javafx/newt/x11/X11Window.java @@ -42,7 +42,7 @@ public class X11Window extends Window { private int nfs_width, nfs_height, nfs_x, nfs_y; static { - NativeLibLoader.loadCore(); + NativeLibLoader.loadNEWT(); if (!initIDs()) { throw new RuntimeException("Failed to initialize jmethodIDs"); diff --git a/src/classes/com/sun/opengl/impl/NativeLibLoader.java b/src/classes/com/sun/opengl/impl/NativeLibLoader.java index 4fe59b003..6a1270ac2 100644 --- a/src/classes/com/sun/opengl/impl/NativeLibLoader.java +++ b/src/classes/com/sun/opengl/impl/NativeLibLoader.java @@ -106,10 +106,37 @@ public class NativeLibLoader { } } - public static void loadCore() { + public static void loadNEWT() { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { - loadLibrary("jogl", null, false, false); + loadLibrary("newt", null, false, false); + return null; + } + }); + } + + public static void loadGL2() { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + loadLibrary("jogl_gl2", null, false, false); + return null; + } + }); + } + + public static void loadES2() { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + loadLibrary("jogl_es2", null, false, false); + return null; + } + }); + } + + public static void loadES1() { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + loadLibrary("jogl_es1", null, false, false); return null; } }); diff --git a/src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java b/src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java index a796aa01c..9ba2a0c40 100755 --- a/src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java @@ -41,9 +41,6 @@ import com.sun.opengl.impl.*; import com.sun.gluegen.runtime.NativeLibrary; public class EGLDrawableFactory extends GLDrawableFactoryImpl { - static { - NativeLibLoader.loadCore(); - } // We need more than one of these on certain devices (the NVidia APX 2500 in particular) private List/*<NativeLibrary>*/ glesLibraries; @@ -70,9 +67,11 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { if (GLProfile.isGLES2()) { glesLibNames.add("libGLESv2_CM"); glesLibNames.add("GLESv2_CM"); - } else { + } else if (GLProfile.isGLES1()) { glesLibNames.add("libGLESv1_CM"); glesLibNames.add("GLESv1_CM"); + } else { + throw new GLException("Invalid GL Profile for EGL: "+GLProfile.getProfile()); } ClassLoader loader = getClass().getClassLoader(); @@ -94,6 +93,12 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { libs.add(eglLib); } glesLibraries = libs; + + if (GLProfile.isGLES2()) { + NativeLibLoader.loadES2(); + } else if (GLProfile.isGLES1()) { + NativeLibLoader.loadES1(); + } } public AbstractGraphicsConfiguration chooseGraphicsConfiguration(GLCapabilities capabilities, diff --git a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java index ae108121c..04c9df103 100644 --- a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java @@ -47,7 +47,7 @@ import com.sun.opengl.impl.*; public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl { static { - NativeLibLoader.loadCore(); + NativeLibLoader.loadGL2(); } public MacOSXCGLDrawableFactory() { diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java index fd4e5620c..4e162f57d 100644 --- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java @@ -54,7 +54,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl { private long hglu32; static { - NativeLibLoader.loadCore(); + NativeLibLoader.loadGL2(); } public WindowsWGLDrawableFactory() { diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java index ed48f9186..dd5e69dcd 100644 --- a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java @@ -88,7 +88,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { // See DRIHack.java for an explanation of why this is necessary DRIHack.begin(); - com.sun.opengl.impl.NativeLibLoader.loadCore(); + com.sun.opengl.impl.NativeLibLoader.loadGL2(); DRIHack.end(); } diff --git a/src/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXDrawableFactory.java b/src/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXDrawableFactory.java index d969f18aa..a6f545b87 100644 --- a/src/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXDrawableFactory.java @@ -58,7 +58,7 @@ public class X11AWTGLXDrawableFactory extends X11GLXDrawableFactory { // See DRIHack.java for an explanation of why this is necessary DRIHack.begin(); - com.sun.opengl.impl.NativeLibLoader.loadCore(); + com.sun.opengl.impl.NativeLibLoader.loadGL2(); DRIHack.end(); } diff --git a/src/native/jogl/EventListener.h b/src/native/newt/EventListener.h index 2e0e92323..2e0e92323 100644 --- a/src/native/jogl/EventListener.h +++ b/src/native/newt/EventListener.h diff --git a/src/native/jogl/KeyEvent.h b/src/native/newt/KeyEvent.h index fed4636b1..fed4636b1 100644 --- a/src/native/jogl/KeyEvent.h +++ b/src/native/newt/KeyEvent.h diff --git a/src/native/jogl/MouseEvent.h b/src/native/newt/MouseEvent.h index 13e805028..13e805028 100644 --- a/src/native/jogl/MouseEvent.h +++ b/src/native/newt/MouseEvent.h diff --git a/src/native/jogl/WindowsWindow.c b/src/native/newt/WindowsWindow.c index cd6844cd2..cd6844cd2 100755 --- a/src/native/jogl/WindowsWindow.c +++ b/src/native/newt/WindowsWindow.c diff --git a/src/native/jogl/X11Window.c b/src/native/newt/X11Window.c index 3f08b5d49..3f08b5d49 100755 --- a/src/native/jogl/X11Window.c +++ b/src/native/newt/X11Window.c |