diff options
author | Sven Gothel <[email protected]> | 2011-07-21 12:32:49 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-07-21 12:32:49 +0200 |
commit | c1fb37cdaff46d23717eac402abaea82e2a503f1 (patch) | |
tree | e3156dce7b1aa000997bfcb81ec3d26bfe9e717b | |
parent | afd46dbeca16a87baba61ae5bfd7767984d66197 (diff) |
Use GlueGen Platform's OSType enum
7 files changed, 36 insertions, 36 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index 3f7c747f8..0c4e767e4 100755 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -55,7 +55,7 @@ function jrun() { #D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT" #D_ARGS="-Dnewt.debug.EDT" # D_ARGS="-Dnativewindow.debug.ToolkitLock.TraceLock -Dnativewindow.debug.X11Util.TraceDisplayLifecycle=true" - #D_ARGS="-Dnativewindow.x11.mt-bug=true" + D_ARGS="-Dnativewindow.x11.mt-bug=true" #D_ARGS="-Dnativewindow.x11.mt-bug=true -Dnativewindow.debug.NativeWindow -Dnativewindow.debug.X11Util -Dnativewindow.debug.ToolkitLock.TraceLock -Dnativewindow.debug.X11Util.TraceDisplayLifecycle=true" #D_ARGS="-Djogamp.common.utils.locks.Lock.timeout=600000 -Djogamp.debug.Lock -Djogamp.debug.Lock.TraceLock" #D_ARGS="-Djogamp.common.utils.locks.Lock.timeout=1000 -Djogamp.debug.Lock -Djogamp.debug.Lock.TraceLock" @@ -100,9 +100,9 @@ function jrun() { echo "Test Start: $*" echo echo $javaexe $X_ARGS $D_ARGS $C_ARG $* - #LD_LIBRARY_PATH=/opt-linux-x86_64/mesa-7.8.1/lib64:$LD_LIBRARY_PATH \ #LD_LIBRARY_PATH=/usr/local/projects/Xorg.modular/build-x86_64/lib:$LD_LIBRARY_PATH \ #LD_LIBRARY_PATH=/opt-linux-x86_64/x11lib-1.3:$LD_LIBRARY_PATH \ + LD_LIBRARY_PATH=/opt-linux-x86_64/mesa-7.8.1/lib64:$LD_LIBRARY_PATH \ $javaexe $X_ARGS $D_ARGS $C_ARG $* echo echo "Test End: $*" @@ -165,7 +165,7 @@ function testawtmt() { #testawt com.jogamp.opengl.test.junit.jogl.awt.TestAWT03GLCanvasRecreate01 $* #testawt com.jogamp.opengl.test.junit.jogl.awt.TestAWT02WindowClosing #testawt com.jogamp.opengl.test.junit.jogl.awt.text.TestAWTTextRendererUseVertexArrayBug464 -#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.TestGearsAWT +#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.TestGearsAWT $* #testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.TestGearsGLJPanelAWT $* #testawt com.jogamp.opengl.test.junit.jogl.texture.TestTexture01AWT #testawt com.jogamp.opengl.test.junit.jogl.caps.TestMultisampleAWT @@ -212,7 +212,7 @@ function testawtmt() { #testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestGLSLSimple01NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestGLSLShaderState01NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestGLSLShaderState02NEWT $* -#testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestRulerNEWT01 $* +testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestRulerNEWT01 $* #testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestFBOMRTNEWT01 $* #testnoawt com.jogamp.opengl.test.junit.graph.TestRegionRendererNEWT01 $* @@ -223,7 +223,7 @@ function testawtmt() { #testnoawt com.jogamp.opengl.test.junit.graph.demos.GPURegionNewtDemo01 $* #testnoawt com.jogamp.opengl.test.junit.graph.demos.GPURegionNewtDemo02 $* -testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGPUMemSec01NEWT $* +#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGPUMemSec01NEWT $* $spath/count-edt-start.sh java-run.log diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java index 530e6fe76..a096934d0 100644 --- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java +++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java @@ -52,6 +52,7 @@ import com.jogamp.gluegen.cgram.types.FunctionSymbol; import com.jogamp.gluegen.procaddress.ProcAddressEmitter; import com.jogamp.gluegen.procaddress.ProcAddressJavaMethodBindingEmitter; import com.jogamp.gluegen.runtime.opengl.GLExtensionNames; + import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java index 4d8c14985..87d870817 100755 --- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java +++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java @@ -45,6 +45,7 @@ import com.jogamp.gluegen.JavaMethodBindingEmitter; import com.jogamp.gluegen.MethodBinding; import com.jogamp.gluegen.cgram.types.Type; import com.jogamp.gluegen.procaddress.ProcAddressJavaMethodBindingEmitter; + import java.io.PrintWriter; /** A specialization of the proc address emitter which knows how to diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java index e8cdcc4b4..bfaf7ac89 100755 --- a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java +++ b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java @@ -46,6 +46,7 @@ import com.jogamp.gluegen.MethodBinding; import com.jogamp.gluegen.cgram.types.FunctionSymbol; import com.jogamp.gluegen.opengl.GLEmitter; import com.jogamp.gluegen.opengl.GLJavaMethodBindingEmitter; + import java.io.PrintWriter; import java.util.ArrayList; import java.util.Iterator; diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java index c0c66a4b3..b4cab2885 100755 --- a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java +++ b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java @@ -47,6 +47,7 @@ import com.jogamp.gluegen.cgram.types.Type; import com.jogamp.gluegen.opengl.GLEmitter; import com.jogamp.gluegen.opengl.GLJavaMethodBindingEmitter; import com.jogamp.gluegen.procaddress.ProcAddressJavaMethodBindingEmitter; + import java.io.PrintWriter; public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBindingEmitter { diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java index 64781e418..3b71555b4 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java +++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java @@ -38,6 +38,8 @@ import java.util.*; import com.jogamp.common.util.*; import com.jogamp.common.jvm.JVMUtil; +import com.jogamp.common.os.Platform; + import jogamp.nativewindow.*; import java.lang.reflect.Constructor; import java.lang.reflect.Method; @@ -73,9 +75,7 @@ public abstract class NativeWindowFactory { private static Map/*<Class, NativeWindowFactory>*/ registeredFactories; private static Class nativeWindowClass; private static String nativeWindowingTypePure; - private static String nativeOSNamePure; private static String nativeWindowingTypeCustom; - private static String nativeOSNameCustom; private static boolean isAWTAvailable; public static final String AWTComponentClassName = "java.awt.Component" ; public static final String JAWTUtilClassName = "jogamp.nativewindow.jawt.JAWTUtil" ; @@ -98,17 +98,22 @@ public abstract class NativeWindowFactory { protected NativeWindowFactory() { } - private static String _getNativeWindowingType(String osNameLowerCase) { - if (osNameLowerCase.startsWith("kd")) { - return TYPE_EGL; - } else if (osNameLowerCase.startsWith("wind")) { - return TYPE_WINDOWS; - } else if (osNameLowerCase.startsWith("mac os x") || - osNameLowerCase.startsWith("darwin")) { + private static String _getNativeWindowingType() { + switch(Platform.OS_TYPE) { + case ANDROID: + throw new RuntimeException(Platform.OS_TYPE+" n/a yet"); + case MACOS: return TYPE_MACOSX; - } else if (osNameLowerCase.equals("awt")) { - return TYPE_AWT; - } else { + case WINDOWS: + return TYPE_WINDOWS; + case OPENKODE: + return TYPE_EGL; + + case LINUX: + case FREEBSD: + case SUNOS: + case HPUX: + default: return TYPE_X11; } } @@ -170,14 +175,12 @@ public abstract class NativeWindowFactory { // Gather the windowing OS first AccessControlContext acc = AccessController.getContext(); - nativeOSNamePure = Debug.getProperty("os.name", false, acc); - nativeWindowingTypePure = _getNativeWindowingType(nativeOSNamePure.toLowerCase()); - nativeOSNameCustom = Debug.getProperty("nativewindow.ws.name", true, acc); - if(null==nativeOSNameCustom||nativeOSNameCustom.length()==0) { - nativeOSNameCustom = nativeOSNamePure; + nativeWindowingTypePure = _getNativeWindowingType(); + String tmp = Debug.getProperty("nativewindow.ws.name", true, acc); + if(null==tmp || tmp.length()==0) { nativeWindowingTypeCustom = nativeWindowingTypePure; } else { - nativeWindowingTypeCustom = nativeOSNameCustom; + nativeWindowingTypeCustom = tmp; } final ClassLoader cl = NativeWindowFactory.class.getClassLoader(); @@ -268,14 +271,6 @@ public abstract class NativeWindowFactory { /** * @param useCustom if false return the native value, if true return a custom value if set, otherwise fallback to the native value. - * @return the native OS name - */ - public static String getNativeOSName(boolean useCustom) { - return useCustom?nativeOSNameCustom:nativeOSNamePure; - } - - /** - * @param useCustom if false return the native value, if true return a custom value if set, otherwise fallback to the native value. * @return a define native window type, like {@link #TYPE_X11}, .. */ public static String getNativeWindowType(boolean useCustom) { diff --git a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java index 3db8f32d2..e3322ac45 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java +++ b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java @@ -32,6 +32,7 @@ package jogamp.nativewindow; +import com.jogamp.common.os.Platform; import com.jogamp.common.util.*; import java.lang.reflect.*; @@ -73,21 +74,21 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory { private NativeWindow getAWTNativeWindow(Object winObj, AbstractGraphicsConfiguration config) { if (nativeWindowConstructor == null) { try { - String osType = getNativeWindowType(true); + String windowingType = getNativeWindowType(true); String windowClassName = null; // We break compile-time dependencies on the AWT here to // make it easier to run this code on mobile devices - if (osType.equals(TYPE_WINDOWS)) { + if (windowingType.equals(TYPE_WINDOWS)) { windowClassName = "jogamp.nativewindow.jawt.windows.WindowsJAWTWindow"; - } else if (osType.equals(TYPE_MACOSX)) { + } else if (windowingType.equals(TYPE_MACOSX)) { windowClassName = "jogamp.nativewindow.jawt.macosx.MacOSXJAWTWindow"; - } else if (osType.equals(TYPE_X11)) { + } else if (windowingType.equals(TYPE_X11)) { // Assume Linux, Solaris, etc. Should probably test for these explicitly. windowClassName = "jogamp.nativewindow.jawt.x11.X11JAWTWindow"; } else { - throw new IllegalArgumentException("OS " + getNativeOSName(false) + " not yet supported"); + throw new IllegalArgumentException("OS " + Platform.getOS() + " not yet supported"); } nativeWindowConstructor = ReflectionUtil.getConstructor( |