aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2008-06-25 05:50:55 +0000
committerSven Gothel <[email protected]>2008-06-25 05:50:55 +0000
commitb02adebb3213e19aecfe84e6966e52976e5c09cf (patch)
tree6435fdac5e3ccad90ae1e96b684e56d79fb57bcf /src/classes/com/sun/opengl
parent800c7da4656277810d579e76b74558434bb6467c (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/classes/com/sun/opengl')
-rw-r--r--src/classes/com/sun/opengl/impl/NativeLibLoader.java31
-rwxr-xr-xsrc/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java13
-rw-r--r--src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java2
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java2
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java2
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXDrawableFactory.java2
6 files changed, 42 insertions, 10 deletions
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();
}