summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-06-29 08:36:09 +0200
committerSven Gothel <[email protected]>2014-06-29 08:36:09 +0200
commitbd76d3fe74c518b509f86c38f8871bec7f5213a2 (patch)
tree8a0a597bc63938d9a22b590a76d03c3bbee59f1e
parenta668ab82817c14c7b29052b1e6f892d19cb074ec (diff)
Bug 1027: Fix usage of atomic jar files (NEWT)
Issue was that 'com.jogamp.opengl.util.PNGPixelRect' was included in jogl-core.jar and that NEWT assumes PNG conversion is possible having this class available. However, PNGPixelRect requires 'jogamp.opengl.util.pngj' which is only included within jogl-util.jar. Moved PNGPixelRect from jogl-core.jar to jogl-util.jar. +++ Added manual test launch 'testnoawtatomics' in make/scripts/tests.sh to test atomic usage. Works now w/ com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT, showing that the window/application icon is _not_ set due to not having PNG* available.
-rwxr-xr-xetc/profile.jogl11
-rw-r--r--make/build-jogl.xml4
-rwxr-xr-xmake/scripts/setenv-jogl.sh3
-rw-r--r--make/scripts/tests.sh23
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java3
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/UITestCase.java12
7 files changed, 43 insertions, 14 deletions
diff --git a/etc/profile.jogl b/etc/profile.jogl
index c898c7082..31cff13ac 100755
--- a/etc/profile.jogl
+++ b/etc/profile.jogl
@@ -50,7 +50,13 @@ JOGL_LIB_ALL="libnativewindow_x11.so libnativewindow_awt.so libjogl_desktop.so l
JOGL_LIB_ALL_NOAWT="libnativewindow_x11.so libjogl_desktop.so libjogl_mobile.so libjogl_cg.so libnewt.so liboculusvr.so"
JOGL_LIB_ALL_MOBILE="libjogl_mobile.so libnewt.so liboculusvr.so"
-export JOGL_JAR_ALL JOGL_JAR_ALL_NOAWT JOGL_JAR_ALL_MOBILE
+ATOMICS_NATIVEWINDOW="atomic/nativewindow-core.jar atomic/nativewindow-os-x11.jar atomic/nativewindow-os-win.jar atomic/nativewindow-os-osx.jar"
+#ATOMICS_JOGL="atomic/jogl-core.jar atomic/jogl-gldesktop.jar atomic/jogl-util.jar atomic/jogl-os-x11.jar atomic/jogl-os-win.jar atomic/jogl-os-osx.jar "
+ATOMICS_JOGL="atomic/jogl-core.jar atomic/jogl-gldesktop.jar atomic/jogl-os-x11.jar atomic/jogl-os-win.jar atomic/jogl-os-osx.jar "
+ATOMICS_NEWT="atomic/newt-core.jar atomic/newt-ogl.jar atomic/newt-driver-x11.jar atomic/newt-driver-win.jar atomic/newt-driver-osx.jar atomic/newt-driver-bcm-vc.jar"
+JOGL_JAR_ATOMICS_NOAWT="$ATOMICS_NATIVEWINDOW $ATOMICS_JOGL $ATOMICS_NEWT"
+
+export JOGL_JAR_ALL JOGL_JAR_ALL_NOAWT JOGL_JAR_ALL_MOBILE JOGL_JAR_ATOMICS_NOAWT
export JOGL_LIB_ALL JOGL_LIB_ALL_NOAWT JOGL_LIB_ALL_MOBILE
THISDIR=`dirname $0`
@@ -86,8 +92,9 @@ export JOGL_LIB_DIR
JOGL_ALL_AWT_CLASSPATH=$(concat_jogl_list "$JOGL_BUILD_DIR" $JOGL_JAR_ALL $JOGL_JAR_OCULUSVR $JOGL_TEST)
JOGL_ALL_NOAWT_CLASSPATH=$(concat_jogl_list "$JOGL_BUILD_DIR" $JOGL_JAR_ALL_NOAWT $JOGL_JAR_OCULUSVR $JOGL_TEST)
JOGL_MOBILE_CLASSPATH=$(concat_jogl_list "$JOGL_BUILD_DIR" $JOGL_JAR_ALL_MOBILE $JOGL_JAR_OCULUSVR $JOGL_TEST)
+JOGL_ATOMICS_NOAWT_CLASSPATH=$(concat_jogl_list "$JOGL_BUILD_DIR" $JOGL_JAR_ATOMICS_NOAWT $JOGL_JAR_OCULUSVR $JOGL_TEST)
JOGL_SWT_CLASSPATH=$(concat_jogl_list "$JOGL_BUILD_DIR" $JOGL_JAR_SWT $JOGL_JAR_OCULUSVR $JOGL_TEST)
-export JOGL_ALL_AWT_CLASSPATH JOGL_ALL_NOAWT_CLASSPATH JOGL_MOBILE_CLASSPATH JOGL_SWT_CLASSPATH
+export JOGL_ALL_AWT_CLASSPATH JOGL_ALL_NOAWT_CLASSPATH JOGL_MOBILE_CLASSPATH JOGL_ATOMICS_NOAWT_CLASSPATH JOGL_SWT_CLASSPATH
if [ ! -z "$JOGL_PROFILE" ] ; then
case "$JOGL_PROFILE" in
diff --git a/make/build-jogl.xml b/make/build-jogl.xml
index 09ca94ab0..9721f4af9 100644
--- a/make/build-jogl.xml
+++ b/make/build-jogl.xml
@@ -93,7 +93,7 @@
<property name="java.part.core"
value="${java.part.gluegen-gl-rt} javax/media/opengl/* javax/media/opengl/fixedfunc/* com/jogamp/opengl/* com/jogamp/opengl/math/** jogamp/opengl/* ${java.part.core.util}"/>
- <property name="java.part.core.exclude" value="javax/media/opengl/Debug* javax/media/opengl/Trace* com/jogamp/opengl/util/AWTAnimatorImpl*"/>
+ <property name="java.part.core.exclude" value="javax/media/opengl/Debug* javax/media/opengl/Trace* com/jogamp/opengl/util/AWTAnimatorImpl* com/jogamp/opengl/util/PNG*"/>
<property name="java.part.nv-cg"
value="com/jogamp/opengl/cg com/jogamp/opengl/cg/* jogamp/opengl/cg/*"/>
@@ -153,7 +153,7 @@
value="com/jogamp/opengl/**/swt/**"/>
<property name="java.part.util"
- value="com/jogamp/opengl/util/texture/** com/jogamp/opengl/util/av/* com/jogamp/opengl/util/packrect/** jogamp/opengl/util/av/** jogamp/opengl/util/jpeg/** jogamp/opengl/util/pngj/**"/>
+ value="com/jogamp/opengl/util/texture/** com/jogamp/opengl/util/av/* com/jogamp/opengl/util/packrect/** com/jogamp/opengl/util/PNG* jogamp/opengl/util/av/** jogamp/opengl/util/jpeg/** jogamp/opengl/util/pngj/**"/>
<property name="java.part.util.awt"
value="com/jogamp/opengl/util/**/awt/**"/>
diff --git a/make/scripts/setenv-jogl.sh b/make/scripts/setenv-jogl.sh
index 1a8106e6c..bbaf5187c 100755
--- a/make/scripts/setenv-jogl.sh
+++ b/make/scripts/setenv-jogl.sh
@@ -110,9 +110,10 @@ LIB=$THISDIR/lib
JOGAMP_ALL_AWT_CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_ALL_AWT_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS":"$SEMVER_JAR":"$GLUEGEN_TESTUTIL_JAR"
JOGAMP_ALL_NOAWT_CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_ALL_NOAWT_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS":"$SEMVER_JAR":"$GLUEGEN_TESTUTIL_JAR"
JOGAMP_MOBILE_CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_MOBILE_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS":"$SEMVER_JAR":"$GLUEGEN_TESTUTIL_JAR"
+JOGAMP_ATOMICS_NOAWT_CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_ATOMICS_NOAWT_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS":"$SEMVER_JAR":"$GLUEGEN_TESTUTIL_JAR"
JOGAMP_ALL_NOAWT_ALT_CLASSPATH=.:"$GLUEGEN_ALT_JAR":"$JOAL_JAR":"$JOGL_ALL_NOAWT_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS":"$SEMVER_JAR":"$GLUEGEN_TESTUTIL_JAR"
JOGAMP_MOBILE_ALT_CLASSPATH=.:"$GLUEGEN_ALT_JAR":"$JOAL_JAR":"$JOGL_MOBILE_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS":"$SEMVER_JAR":"$GLUEGEN_TESTUTIL_JAR"
-export JOGAMP_ALL_AWT_CLASSPATH JOGAMP_ALL_NOAWT_CLASSPATH JOGAMP_MOBILE_CLASSPATH JOGAMP_ALL_NOAWT_ALT_CLASSPATH JOGAMP_MOBILE_ALT_CLASSPATH
+export JOGAMP_ALL_AWT_CLASSPATH JOGAMP_ALL_NOAWT_CLASSPATH JOGAMP_MOBILE_CLASSPATH JOGAMP_ATOMICS_NOAWT_CLASSPATH JOGAMP_ALL_NOAWT_ALT_CLASSPATH JOGAMP_MOBILE_ALT_CLASSPATH
CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS":"$SEMVER_JAR":"$GLUEGEN_TESTUTIL_JAR"
export CLASSPATH
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index aa06046df..fe6d70db8 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -284,12 +284,12 @@ function jrun() {
export USE_CLASSPATH=$JOGAMP_ALL_AWT_CLASSPATH
echo USE_CLASSPATH $USE_CLASSPATH
X_ARGS="-Djava.awt.headless=true $X_ARGS"
+ elif [ $awton -eq -1 ] ; then
+ export USE_CLASSPATH=$JOGAMP_ATOMICS_NOAWT_CLASSPATH
else
#export USE_CLASSPATH=$JOGAMP_ALL_AWT_CLASSPATH
export USE_CLASSPATH=$JOGAMP_ALL_NOAWT_CLASSPATH
#export USE_CLASSPATH=$JOGAMP_MOBILE_CLASSPATH
- #export USE_CLASSPATH=$JOGAMP_ALL_NOAWT_ALT_CLASSPATH
- #export USE_CLASSPATH=$JOGAMP_MOBILE_ALT_CLASSPATH
#export USE_CLASSPATH=.:$GLUEGEN_JAR:$JOGL_BUILD_DIR/jar/atomic/jogl-core.jar:$JOGL_BUILD_DIR/jar/atomic/jogl-gldesktop.jar:$JOGL_BUILD_DIR/jar/atomic/jogl-os-x11.jar:$JOGL_BUILD_DIR/jar/atomic/jogl-util.jar:$JOGL_BUILD_DIR/jar/atomic/nativewindow-core.jar:$JOGL_BUILD_DIR/jar/atomic/nativewindow-os-x11.jar:$JOGL_BUILD_DIR/jar/atomic/newt-core.jar:$JOGL_BUILD_DIR/jar/atomic/newt-driver-x11.jar:$JOGL_BUILD_DIR/jar/atomic/newt-ogl.jar:$JOGL_BUILD_DIR/jar/jogl-test.jar:$SWT_CLASSPATH:$JUNIT_JAR:$ANT_JARS
X_ARGS="-Djava.awt.headless=true $X_ARGS"
fi
@@ -327,21 +327,25 @@ function jrun() {
echo
}
+function testnoawtatomics() {
+ jrun -1 0 $* 2>&1 | tee -a java-run.log
+}
+
function testnoawt() {
- jrun 0 0 $* 2>&1 | tee -a java-run.log
+ jrun 0 0 $* 2>&1 | tee -a java-run.log
}
function testawt() {
MOSX_MT=0
- jrun 1 0 $* 2>&1 | tee -a java-run.log
+ jrun 1 0 $* 2>&1 | tee -a java-run.log
}
function testswt() {
- jrun 0 1 $* 2>&1 | tee -a java-run.log
+ jrun 0 1 $* 2>&1 | tee -a java-run.log
}
function testawtswt() {
- jrun 1 1 $* 2>&1 | tee -a java-run.log
+ jrun 1 1 $* 2>&1 | tee -a java-run.log
}
#
@@ -352,7 +356,8 @@ function testawtswt() {
#testnoawt com.jogamp.nativewindow.NativeWindowVersion $*
#testnoawt com.jogamp.opengl.JoglVersion $*
#testnoawt com.jogamp.newt.NewtVersion $*
-testnoawt com.jogamp.oculusvr.OVRVersion $*
+#testnoawt com.jogamp.oculusvr.OVRVersion $*
+
#testnoawt com.jogamp.newt.opengl.GLWindow $*
#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLVersionParsing00NEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestMainVersionGLWindowNEWT $*
@@ -389,6 +394,7 @@ testnoawt com.jogamp.oculusvr.OVRVersion $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NEWT $*
#testawtswt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestElektronenMultipliziererNEWT $*
+testnoawtatomics com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestRedSquareES2NEWT $*
#testswt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT $*
@@ -435,12 +441,13 @@ testnoawt com.jogamp.oculusvr.OVRVersion $*
# CORE [NEWT + AWT] (testnoawt and testawt)
#
#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestFloatUtil01NOUI $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestFloatUtil02MatrixMatrixMultNOUI $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestFloatUtil03InversionNOUI $*
#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestPMVMatrix01NEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestPMVMatrix02NOUI $*
#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestPMVMatrix03NOUI $*
#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestGluUnprojectFloatNOUI $*
#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestGluUnprojectDoubleNOUI $*
-#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestFloatUtil01MatrixMatrixMultNOUI $*
#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestBinary16NOUI $*
#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestQuaternion01NOUI $*
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java
index db219b116..578a887d9 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java
@@ -68,6 +68,7 @@ import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
import jogamp.newt.DefaultEDTUtil;
+import jogamp.newt.driver.PNGIcon;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -217,7 +218,7 @@ public class TestGearsES2NEWT extends UITestCase {
}
pointerIcons[1] = _pointerIcon;
}
- {
+ if( PNGIcon.isAvailable() ) {
PointerIcon _pointerIcon = null;
final IOUtil.ClassResources res = new IOUtil.ClassResources(glWindow.getClass(), new String[] { "jogamp-pointer-64x64.png" } );
try {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java
index 800bef046..de824571e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java
@@ -203,6 +203,7 @@ public class TestRedSquareES2NEWT extends UITestCase {
loop_shutdown = true;
}
}
+ System.err.println("duration "+duration);
System.err.println("loops "+loops);
System.err.println("loop shutdown "+loop_shutdown);
System.err.println("forceES2 "+forceES2);
diff --git a/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java b/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
index d37760ec3..e6958bc48 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
@@ -333,12 +333,24 @@ public abstract class UITestCase {
* If <code>null</code> the current working directory is being used.
*/
public void snapshot(int sn, String postSNDetail, GL gl, GLReadBufferUtil readBufferUtil, String fileSuffix, String destPath) {
+
final GLDrawable drawable = gl.getContext().getGLReadDrawable();
final String filename = getSnapshotFilename(sn, postSNDetail,
drawable.getChosenGLCapabilities(), drawable.getSurfaceWidth(), drawable.getSurfaceHeight(),
readBufferUtil.hasAlpha(), fileSuffix, destPath);
System.err.println(Thread.currentThread().getName()+": ** screenshot: "+filename);
gl.glFinish(); // just make sure rendering finished ..
+ try {
+ snapshot(gl, readBufferUtil, filename);
+ } catch (ClassNotFoundException cnfe) {
+ // Texture class belongs to jogl-util.jar which my not be included in test environment!
+ System.err.println("Caught ClassNotFoundException: "+cnfe.getMessage());
+ } catch (NoClassDefFoundError cnfe) {
+ // Texture class belongs to jogl-util.jar which my not be included in test environment!
+ System.err.println("Caught NoClassDefFoundError: "+cnfe.getMessage());
+ }
+ }
+ private void snapshot(GL gl, GLReadBufferUtil readBufferUtil, String filename) throws ClassNotFoundException, NoClassDefFoundError {
if(readBufferUtil.readPixels(gl, false)) {
readBufferUtil.write(new File(filename));
}