diff options
author | Xerxes Rånby <[email protected]> | 2012-09-30 00:51:39 +0200 |
---|---|---|
committer | Xerxes Rånby <[email protected]> | 2012-09-30 00:51:39 +0200 |
commit | 8a1e50dc33e14e9423e2f4bc066b32a835bb33fb (patch) | |
tree | 365feafa6e3b6d5099682ce5d3319728bed8cfa7 /src/nativewindow | |
parent | 43891be36e8485353ac74f329fd2f7438303a846 (diff) |
_getNativeWindowingType() TYPE_BCM_VC_IV autodetection.
Signed-off-by: Xerxes Rånby <[email protected]>
Diffstat (limited to 'src/nativewindow')
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java index 4f4bb629b..d1ec3a4da 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java +++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java @@ -33,6 +33,7 @@ package javax.media.nativewindow; +import java.io.File; import java.lang.reflect.Method; import java.security.AccessController; import java.security.PrivilegedAction; @@ -65,6 +66,9 @@ public abstract class NativeWindowFactory { /** X11 type, as retrieved with {@link #getNativeWindowType(boolean)}. String is canonical via {@link String#intern()}. */ public static final String TYPE_X11 = ".x11".intern(); + /** Broadcom VC IV/EGL type, as retrieved with {@link #getNativeWindowType(boolean)}. String is canonical via {@link String#intern()}. */ + public static final String TYPE_BCM_VC_IV = "jogamp.newt.driver.bcm.vc.iv".intern(); + /** Android/EGL type, as retrieved with {@link #getNativeWindowType(boolean)}. String is canonical via {@link String#intern()}.*/ public static final String TYPE_ANDROID = ".android".intern(); @@ -102,6 +106,18 @@ public abstract class NativeWindowFactory { protected NativeWindowFactory() { } + private static final boolean guessBroadcomVCIV() { + return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + private final File vcliblocation = new File( + "/opt/vc/lib/libbcm_host.so"); + public Boolean run() { + if ( vcliblocation.isFile() ) { + return new Boolean(true); + } + return new Boolean(false); + } } ).booleanValue(); + } + private static String _getNativeWindowingType() { switch(Platform.OS_TYPE) { case ANDROID: @@ -118,6 +134,8 @@ public abstract class NativeWindowFactory { case SUNOS: case HPUX: default: + if(guessBroadcomVCIV()) + return TYPE_BCM_VC_IV; return TYPE_X11; } } |