summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <sgothel@jausoft.com>2010-11-09 20:07:21 +0100
committerSven Gothel <sgothel@jausoft.com>2010-11-09 20:07:21 +0100
commit597d10f5a5f743a51cfe56f3c381fd80e941a394 (patch)
treef28d0fcfaab03fc0534c0308a577ca0c0cc93d4f
parent7dce462b56f1e77e3cc2b68cb72c27a549c53f91 (diff)
Adding simple static main test entry to provide standalone autobuild verification
-rwxr-xr-xetc/test.bat10
-rwxr-xr-xetc/test.sh44
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/VersionInfo.java2
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLCanvas.java55
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java32
5 files changed, 143 insertions, 0 deletions
diff --git a/etc/test.bat b/etc/test.bat
new file mode 100755
index 0000000..8082343
--- /dev/null
+++ b/etc/test.bat
@@ -0,0 +1,10 @@
+
+set BLD_DIR=jar
+set LIB_DIR=lib
+
+set CP_ALL=.;%BLD_DIR%\gluegen-rt.jar;%BLD_DIR%\nativewindow.all.jar;%BLD_DIR%\jogl.all.jar;%BLD_DIR%\newt.all.jar
+echo CP_ALL %CP_ALL%
+
+set X_ARGS="-Dsun.java2d.noddraw=true" "-Dsun.awt.noerasebackground=true"
+
+%J2RE_HOME%\bin\java -classpath %CP_ALL% "-Djava.library.path=%LIB_DIR%" %X_ARGS% %1 %2 %3 %4 %5 %6 %7 %8 %9 > java-win64.log 2>&1
diff --git a/etc/test.sh b/etc/test.sh
new file mode 100755
index 0000000..d866873
--- /dev/null
+++ b/etc/test.sh
@@ -0,0 +1,44 @@
+#! /bin/bash
+
+THISDIR=`pwd`
+logfile=`basename $0 .sh`.log
+
+rm -f $logfile
+
+which java 2>&1 | tee -a $logfile
+java -version 2>&1 | tee -a $logfile
+echo LIBXCB_ALLOW_SLOPPY_LOCK: $LIBXCB_ALLOW_SLOPPY_LOCK 2>&1 | tee -a $logfile
+echo LIBGL_DRIVERS_PATH: $LIBGL_DRIVERS_PATH 2>&1 | tee -a $logfile
+echo LIBGL_DEBUG: $LIBGL_DEBUG 2>&1 | tee -a $logfile
+echo java $X_ARGS $D_ARGS $* 2>&1 | tee -a $logfile
+
+CLASSPATH=jar/gluegen-rt.jar:jar/nativewindow.all.jar:jar/jogl.all.jar:jar/newt.all.jar
+export CLASSPATH
+
+export LD_LIBRARY_PATH=./lib:$LD_LIBRARY_PATH
+export DYLD_LIBRARY_PATH=./lib:$DYLD_LIBRARY_PATH
+echo LD_LIBRARY PATH: $LD_LIBRARY_PATH
+echo DYLD_LIBRARY PATH: $DYLD_LIBRARY_PATH
+echo
+
+echo CLASSPATH: $CLASSPATH
+echo
+
+# D_ARGS="-Djogamp.debug.TraceLock"
+# D_ARGS="-Dnewt.debug.EDT -Dnativewindow.debug.ToolkitLock.TraceLock -Dnativewindow.debug.NativeWindow"
+# D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT"
+# D_ARGS="-Dnewt.debug.EDT -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="-Dnewt.debug.Window -Dnewt.debug.EDT -Dnewt.debug.Display "
+#D_ARGS="-Dnewt.debug.EDT -Djogamp.common.utils.locks.Lock.timeout=600000 -Djogl.debug.Animator -Dnewt.debug.Display -Dnewt.debug.Screen"
+#D_ARGS="-Dnewt.debug.EDT -Dnewt.debug.Display -Dnativewindow.debug.X11Util -Djogl.debug.GLDrawable -Djogl.debug.GLCanvas"
+#D_ARGS="-Dnewt.debug.EDT -Djogl.debug.GLContext"
+#D_ARGS="-Dnewt.debug.Screen -Dnewt.debug.EDT -Djogamp.debug.Lock"
+#D_ARGS="-Dnewt.debug.EDT"
+#D_ARGS="-Dnewt.debug.EDT -Djogl.debug=all -Dnativewindow.debug=all"
+# D_ARGS="-Djogl.debug=all"
+X_ARGS="-Dsun.java2d.noddraw=true -Dsun.java2d.opengl=false"
+
+#java $X_ARGS $ARGS_AWT $D_ARGS javax.media.opengl.awt.GLCanvas 2>&1 | tee -a $logfile
+java $X_ARGS $ARGS_NEWT $D_ARGS com.jogamp.newt.opengl.GLWindow 2>&1 | tee -a $logfile
+
diff --git a/src/jogl/classes/com/jogamp/opengl/util/VersionInfo.java b/src/jogl/classes/com/jogamp/opengl/util/VersionInfo.java
index 0359ef4..b7e6b51 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/VersionInfo.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/VersionInfo.java
@@ -78,6 +78,8 @@ public class VersionInfo {
sb = new StringBuffer();
}
+ sb.append(prefix+" "+GLProfile.glAvailabilityToString());
+ sb.append(Platform.getNewline());
sb.append(prefix+" Swap Interval " + gl.getSwapInterval());
sb.append(Platform.getNewline());
sb.append(prefix+" GL Profile " + gl.getGLProfile());
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
index d2a20f4..22b2574 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
@@ -45,12 +45,14 @@ import javax.media.nativewindow.*;
import javax.media.nativewindow.awt.*;
import com.jogamp.opengl.impl.*;
+import com.jogamp.opengl.util.VersionInfo;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Component;
import java.awt.EventQueue;
import java.awt.FontMetrics;
+import java.awt.Frame;
import java.awt.Graphics;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
@@ -787,4 +789,57 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
return config;
}
+
+ /**
+ * A most simple JOGL AWT test entry
+ */
+ public static void main(String args[]) {
+ GLCapabilities caps = new GLCapabilities( GLProfile.getDefault() );
+ Frame frame = new Frame("JOGL AWT Test");
+
+ GLCanvas glCanvas = new GLCanvas(caps);
+ frame.add(glCanvas);
+ frame.setSize(128, 128);
+
+ glCanvas.addGLEventListener(new GLEventListener() {
+ public void init(GLAutoDrawable drawable) {
+ GL gl = drawable.getGL();
+ String prefix = "JOGL AWT Test " + Thread.currentThread().getName();
+ System.err.println(VersionInfo.getInfo(null, prefix, gl).toString());
+ }
+
+ public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ }
+
+ public void display(GLAutoDrawable drawable) {
+ }
+
+ public void dispose(GLAutoDrawable drawable) {
+ }
+ });
+
+ final Frame _frame = frame;
+ final GLCanvas _glCanvas = glCanvas;
+
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ _frame.setVisible(true);
+ }});
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ glCanvas.display();
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ _frame.setVisible(false);
+ _frame.remove(_glCanvas);
+ _frame.dispose();
+ }});
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
}
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index 36302c5..b1ad2fd 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -41,6 +41,7 @@ import javax.media.nativewindow.*;
import javax.media.nativewindow.util.Point;
import javax.media.opengl.*;
import com.jogamp.opengl.impl.GLDrawableHelper;
+import com.jogamp.opengl.util.VersionInfo;
import javax.media.nativewindow.util.Insets;
/**
@@ -840,4 +841,35 @@ public class GLWindow implements GLAutoDrawable, Window {
public final void surfaceUpdated(Object updater, NativeSurface ns, long when) {
window.surfaceUpdated(updater, ns, when);
}
+
+ /**
+ * A most simple JOGL AWT test entry
+ */
+ public static void main(String args[]) {
+ GLCapabilities caps = new GLCapabilities( GLProfile.getDefault() );
+
+ GLWindow glWindow = GLWindow.create(caps);
+ glWindow.setSize(128, 128);
+
+ glWindow.addGLEventListener(new GLEventListener() {
+ public void init(GLAutoDrawable drawable) {
+ GL gl = drawable.getGL();
+ String prefix = "JOGL NEWT Test " + Thread.currentThread().getName();
+ System.err.println(VersionInfo.getInfo(null, prefix, gl).toString());
+ }
+
+ public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ }
+
+ public void display(GLAutoDrawable drawable) {
+ }
+
+ public void dispose(GLAutoDrawable drawable) {
+ }
+ });
+
+ glWindow.setVisible(true);
+ glWindow.destroy(true);
+ }
+
}