aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-07-03 04:34:02 +0000
committerSven Gothel <[email protected]>2009-07-03 04:34:02 +0000
commit05cab54625f7482b1179cabe4902fbbbb53ea44d (patch)
tree366001efdb204266f59910145010183a2411af45 /src/jogl
parentd6ec90ca7bfe9ee217386365c819659c161a10f6 (diff)
Fix property handling ; Adding jnlp. aliasing for properties
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@2016 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/jogl')
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/DRIHack.java4
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/Debug.java32
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/NativeLibLoader.java11
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/ThreadingImpl.java2
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/egl/EGLDrawable.java2
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java2
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java7
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/texture/Texture.java4
-rw-r--r--src/jogl/classes/javax/media/opengl/GLAutoDrawable.java3
-rw-r--r--src/jogl/classes/javax/media/opengl/GLDrawableFactory.java8
10 files changed, 36 insertions, 39 deletions
diff --git a/src/jogl/classes/com/sun/opengl/impl/DRIHack.java b/src/jogl/classes/com/sun/opengl/impl/DRIHack.java
index 5478bd2f3..63a2f7ecd 100755
--- a/src/jogl/classes/com/sun/opengl/impl/DRIHack.java
+++ b/src/jogl/classes/com/sun/opengl/impl/DRIHack.java
@@ -83,7 +83,7 @@ public class DRIHack {
public static void begin() {
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
- String os = System.getProperty("os.name").toLowerCase();
+ String os = Debug.getProperty("os.name", false).toLowerCase();
// Do DRI hack on all Linux distributions for best robustness
driHackNeeded =
(os.startsWith("linux") ||
@@ -91,7 +91,7 @@ public class DRIHack {
new File("/usr/X11R6/lib/modules/dri").exists());
// Allow manual overriding for now as a workaround for
// problems seen in some situations -- needs more investigation
- if (System.getProperty("jogl.drihack.disable") != null) {
+ if (Debug.getProperty("jogl.drihack.disable", true) != null) {
driHackNeeded = false;
}
return null;
diff --git a/src/jogl/classes/com/sun/opengl/impl/Debug.java b/src/jogl/classes/com/sun/opengl/impl/Debug.java
index 9faa04fa7..b34b8e108 100644
--- a/src/jogl/classes/com/sun/opengl/impl/Debug.java
+++ b/src/jogl/classes/com/sun/opengl/impl/Debug.java
@@ -59,25 +59,37 @@ public class Debug {
}
}
- public static boolean getBooleanProperty(final String property) {
- Boolean b = (Boolean) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- boolean val = Boolean.getBoolean(property);
- return (val ? Boolean.TRUE : Boolean.FALSE);
- }
- });
+ public static int getIntProperty(final String property, final boolean jnlpAlias) {
+ int i=0;
+ try {
+ Integer iv = Integer.valueOf(Debug.getProperty(property, jnlpAlias));
+ i = iv.intValue();
+ } catch (NumberFormatException nfe) {}
+ return i;
+ }
+
+ public static boolean getBooleanProperty(final String property, final boolean jnlpAlias) {
+ Boolean b = Boolean.valueOf(Debug.getProperty(property, jnlpAlias));
return b.booleanValue();
}
public static boolean isPropertyDefined(final String property) {
- Boolean b = (Boolean) AccessController.doPrivileged(new PrivilegedAction() {
+ return (Debug.getProperty(property, true) != null) ? true : false;
+ }
+
+ public static String getProperty(final String property, final boolean jnlpAlias) {
+ String s = (String) AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
String val = System.getProperty(property);
- return (val != null ? Boolean.TRUE : Boolean.FALSE);
+ if(null==val && jnlpAlias && !property.startsWith(jnlp_prefix)) {
+ val = System.getProperty(jnlp_prefix + property);
+ }
+ return val;
}
});
- return b.booleanValue();
+ return s;
}
+ public static final String jnlp_prefix = "jnlp." ;
public static boolean verbose() {
return verbose;
diff --git a/src/jogl/classes/com/sun/opengl/impl/NativeLibLoader.java b/src/jogl/classes/com/sun/opengl/impl/NativeLibLoader.java
index 12dc8fc7d..5082f01dd 100644
--- a/src/jogl/classes/com/sun/opengl/impl/NativeLibLoader.java
+++ b/src/jogl/classes/com/sun/opengl/impl/NativeLibLoader.java
@@ -147,13 +147,8 @@ public class NativeLibLoader extends NativeLibLoaderBase {
static {
NativeLibLoaderBase.setLoadingAction(new JOGLAction());
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- String sunAppletLauncher = System.getProperty("sun.jnlp.applet.launcher");
- usingJNLPAppletLauncher = Boolean.valueOf(sunAppletLauncher).booleanValue();
- return null;
- }
- });
+ String sunAppletLauncher = Debug.getProperty("sun.jnlp.applet.launcher", false);
+ usingJNLPAppletLauncher = Boolean.valueOf(sunAppletLauncher).booleanValue();
}
// I hate the amount of delegation currently in this class
@@ -182,7 +177,7 @@ public class NativeLibLoader extends NativeLibLoaderBase {
}
} else {
// FIXME: remove
- // System.out.println("sun.boot.library.path=" + System.getProperty("sun.boot.library.path"));
+ // System.out.println("sun.boot.library.path=" + Debug.getProperty("sun.boot.library.path", false));
System.loadLibrary(libraryName);
if(DEBUG) {
System.err.println("JOGL Loaded Native Library: "+libraryName);
diff --git a/src/jogl/classes/com/sun/opengl/impl/ThreadingImpl.java b/src/jogl/classes/com/sun/opengl/impl/ThreadingImpl.java
index 6c8633c10..4a4b2d5f9 100644
--- a/src/jogl/classes/com/sun/opengl/impl/ThreadingImpl.java
+++ b/src/jogl/classes/com/sun/opengl/impl/ThreadingImpl.java
@@ -62,7 +62,7 @@ public class ThreadingImpl {
Object threadingPluginTmp =
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
- String workaround = System.getProperty("opengl.1thread");
+ String workaround = Debug.getProperty("jogl.1thread", true);
// Default to using the AWT thread on all platforms except
// Windows. On OS X there is instability apparently due to
// using the JAWT on non-AWT threads. On X11 platforms there
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawable.java
index a3d83ac36..d2907c83d 100755
--- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawable.java
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawable.java
@@ -118,7 +118,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
// create a new EGL config ..
ownEGLDisplay=true;
long nDisplay;
- if( NativeWindowFactory.getNativeWindowType(false)==NativeWindowFactory.TYPE_WINDOWS ) {
+ if( NativeWindowFactory.TYPE_WINDOWS.equals(NativeWindowFactory.getNativeWindowType(false)) ) {
nDisplay = component.getSurfaceHandle(); // don't even ask ..
} else {
nDisplay = aDevice.getHandle(); // 0 == EGL.EGL_DEFAULT_DISPLAY
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java
index 97080b5f7..8bed0eb35 100755
--- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java
@@ -181,7 +181,7 @@ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper {
private long dynamicLookupFunctionOnLibs(String glFuncName) {
String funcName=glFuncName;
long addr = dynamicLookupFunctionOnLibsImpl(funcName);
- if( 0==addr && NativeWindowFactory.getNativeWindowType(false)==NativeWindowFactory.TYPE_WINDOWS ) {
+ if( 0==addr && NativeWindowFactory.TYPE_WINDOWS.equals(NativeWindowFactory.getNativeWindowType(false)) ) {
// Hack: try some C++ decoration here for Imageon's emulation libraries ..
final int argAlignment=4; // 4 byte alignment of each argument
final int maxArguments=12; // experience ..
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java
index 4a8712b06..33fdea384 100644
--- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java
@@ -17,12 +17,7 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext {
private static boolean isTigerOrLater;
static {
- String osVersion =
- (String) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty("os.version");
- }
- });
+ String osVersion = Debug.getProperty("os.version", false);
StringTokenizer tok = new StringTokenizer(osVersion, ". ");
int major = Integer.parseInt(tok.nextToken());
int minor = Integer.parseInt(tok.nextToken());
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/Texture.java b/src/jogl/classes/com/sun/opengl/util/texture/Texture.java
index 776045f41..c8dda5ed5 100755
--- a/src/jogl/classes/com/sun/opengl/util/texture/Texture.java
+++ b/src/jogl/classes/com/sun/opengl/util/texture/Texture.java
@@ -40,6 +40,7 @@ import java.nio.*;
import javax.media.opengl.*;
import javax.media.opengl.glu.*;
+import javax.media.nativewindow.NativeWindowFactory;
import com.sun.opengl.impl.*;
import com.sun.opengl.util.texture.*;
import com.sun.opengl.util.texture.spi.*;
@@ -1096,8 +1097,7 @@ public class Texture {
// Prefer GL_ARB_texture_rectangle on ATI hardware on Mac OS X
// due to software fallbacks
- String osName = System.getProperty("os.name").toLowerCase();
- if (osName.startsWith("mac os x")) {
+ if (NativeWindowFactory.TYPE_MACOSX.equals(NativeWindowFactory.getNativeWindowType(false))) {
String vendor = gl.glGetString(GL.GL_VENDOR);
if (vendor != null && vendor.startsWith("ATI")) {
return true;
diff --git a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
index 6b1067701..f0450e89e 100644
--- a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
@@ -40,6 +40,7 @@
package javax.media.opengl;
import javax.media.opengl.glu.*;
+import com.sun.opengl.impl.Debug;
/** A higher-level abstraction than {@link GLDrawable} which supplies
an event based mechanism ({@link GLEventListener}) for performing
@@ -111,7 +112,7 @@ public interface GLAutoDrawable extends GLDrawable {
/** Flag reflecting wheather the drawable reconfiguration will be issued in
* case a screen device change occured, e.g. in a multihead environment,
* where you drag the window to another monitor. */
- public static final boolean SCREEN_CHANGE_ACTION_ENABLED = Boolean.getBoolean("jogl.screenchange.action");
+ public static final boolean SCREEN_CHANGE_ACTION_ENABLED = Debug.getBooleanProperty("jogl.screenchange.action", true);
/** FIXME:
** Invalid state, the resources are not yet ready to render. *
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
index 5da62c30a..3724556db 100644
--- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
@@ -109,13 +109,7 @@ public abstract class GLDrawableFactory {
String factoryClassName = null;
tmp = null;
try {
- factoryClassName =
- (String) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty("opengl.factory.class.name");
- }
- });
-
+ factoryClassName = Debug.getProperty("jogl.gldrawablefactory.class.name", true);
if (null == factoryClassName) {
if ( nativeOSType.equals(NativeWindowFactory.TYPE_EGL) ) {
// use egl*Factory ..