diff --git a/.classpath b/.classpath
index 37991c32..c17f2bb6 100644
--- a/.classpath
+++ b/.classpath
@@ -28,5 +28,6 @@
+
diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
index d3c73b5f..fd1e7846 100644
--- a/.settings/org.eclipse.core.resources.prefs
+++ b/.settings/org.eclipse.core.resources.prefs
@@ -2,12 +2,11 @@ eclipse.preferences.version=1
encoding//src/org/nevec/rjm/BigSurd.java=UTF-8
encoding//src/org/nevec/rjm/BigSurdVec.java=UTF-8
encoding//src/org/warp/picalculator/Main.java=UTF-8
-encoding//src/org/warp/picalculator/device/graphicengine=UTF-8
-encoding//src/org/warp/picalculator/device/graphicengine/Display.java=UTF-8
+encoding//src/org/warp/picalculator/gui/graphicengine/cpu/CPUDisplay.java=UTF-8
+encoding//src/org/warp/picalculator/gui/screens/MathInputScreen.java=UTF-8
encoding//src/org/warp/picalculator/math/MathematicalSymbols.java=UTF-8
encoding//src/org/warp/picalculator/math/functions/Expression.java=UTF-8
encoding//src/org/warp/picalculator/math/functions/Root.java=UTF-8
encoding//src/org/warp/picalculator/math/functions/RootSquare.java=UTF-8
encoding//src/org/warp/picalculator/math/functions/Sum.java=UTF-8
-encoding//src/org/warp/picalculator/screens/MathInputScreen.java=UTF-8
encoding/=UTF-8
diff --git a/libs/jogamp-all-platforms/aggregated.artifact.properties.sorted b/libs/jogamp-all-platforms/aggregated.artifact.properties.sorted
new file mode 100644
index 00000000..ec155107
--- /dev/null
+++ b/libs/jogamp-all-platforms/aggregated.artifact.properties.sorted
@@ -0,0 +1,8 @@
+gluegen.build.number=900
+joal.build.number=626
+joal-demos.build.number=511
+jocl.build.number=1106
+jocl-demos.build.number=1000
+jogl.build.number=1469
+jogl-demos.build.number=471
+jogl-demos.build.number=78
diff --git a/libs/jogamp-all-platforms/all.artifact.properties.sorted b/libs/jogamp-all-platforms/all.artifact.properties.sorted
new file mode 100644
index 00000000..add94178
--- /dev/null
+++ b/libs/jogamp-all-platforms/all.artifact.properties.sorted
@@ -0,0 +1,32 @@
+gluegen.build.branch=origin/master
+gluegen.build.commit=cc1e9bc698b7f11097c1e114027e53121552f280
+gluegen.build.id=900
+gluegen.build.number=900
+gluegen.build.version=2.3.2
+joal.build.branch=origin/master
+joal.build.commit=1dace826e127704c4058c684c993816581c31094
+joal.build.id=626
+joal.build.number=626
+joal.build.version=2.3.2
+joal-demos.build.branch=origin/master
+joal-demos.build.commit=9a86b8e9a8834d2727865eb3f4a2a4e89e54c3fc
+joal-demos.build.id=511
+joal-demos.build.number=511
+jocl.build.branch=origin/master
+jocl.build.commit=00de3f241f2c6132e1d548ae3f19c574e62275d6
+jocl.build.id=1106
+jocl.build.number=1106
+jocl.build.version=2.3.2
+jocl-demos.build.branch=origin/master
+jocl-demos.build.commit=056e8808a5ab3076c5a48c75b1ec7f811122caf9
+jocl-demos.build.id=1000
+jocl-demos.build.number=1000
+jogl.build.branch=origin/master
+jogl.build.commit=e794fc40ba723f2fca4ac892e873975fb393e007
+jogl.build.id=1469
+jogl.build.number=1469
+jogl.build.version=2.3.2
+jogl-demos.build.branch=origin/master
+jogl-demos.build.commit=7a4f9fe683cabff00e941fd3cd8a257822e21923
+jogl-demos.build.id=471
+jogl-demos.build.number=471
diff --git a/libs/jogamp-all-platforms/apk/gluegen-rt-android-aarch64.apk b/libs/jogamp-all-platforms/apk/gluegen-rt-android-aarch64.apk
new file mode 100644
index 00000000..a65cb213
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/gluegen-rt-android-aarch64.apk differ
diff --git a/libs/jogamp-all-platforms/apk/gluegen-rt-android-armv6.apk b/libs/jogamp-all-platforms/apk/gluegen-rt-android-armv6.apk
new file mode 100644
index 00000000..d5eda088
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/gluegen-rt-android-armv6.apk differ
diff --git a/libs/jogamp-all-platforms/apk/joal-android-aarch64.apk b/libs/jogamp-all-platforms/apk/joal-android-aarch64.apk
new file mode 100644
index 00000000..2a3af209
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/joal-android-aarch64.apk differ
diff --git a/libs/jogamp-all-platforms/apk/joal-android-armv6.apk b/libs/jogamp-all-platforms/apk/joal-android-armv6.apk
new file mode 100644
index 00000000..3e328ae0
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/joal-android-armv6.apk differ
diff --git a/libs/jogamp-all-platforms/apk/joal-test-android.apk b/libs/jogamp-all-platforms/apk/joal-test-android.apk
new file mode 100644
index 00000000..645aeb12
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/joal-test-android.apk differ
diff --git a/libs/jogamp-all-platforms/apk/jocl-android-aarch64.apk b/libs/jogamp-all-platforms/apk/jocl-android-aarch64.apk
new file mode 100644
index 00000000..959bb8c0
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/jocl-android-aarch64.apk differ
diff --git a/libs/jogamp-all-platforms/apk/jocl-android-armv6.apk b/libs/jogamp-all-platforms/apk/jocl-android-armv6.apk
new file mode 100644
index 00000000..1266adba
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/jocl-android-armv6.apk differ
diff --git a/libs/jogamp-all-platforms/apk/jocl-test-android.apk b/libs/jogamp-all-platforms/apk/jocl-test-android.apk
new file mode 100644
index 00000000..de63b43d
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/jocl-test-android.apk differ
diff --git a/libs/jogamp-all-platforms/apk/jogamp-android-launcher.apk b/libs/jogamp-all-platforms/apk/jogamp-android-launcher.apk
new file mode 100644
index 00000000..551ec156
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/jogamp-android-launcher.apk differ
diff --git a/libs/jogamp-all-platforms/apk/jogl-all-android-aarch64.apk b/libs/jogamp-all-platforms/apk/jogl-all-android-aarch64.apk
new file mode 100644
index 00000000..a4983486
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/jogl-all-android-aarch64.apk differ
diff --git a/libs/jogamp-all-platforms/apk/jogl-all-android-armv6.apk b/libs/jogamp-all-platforms/apk/jogl-all-android-armv6.apk
new file mode 100644
index 00000000..723ba1cc
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/jogl-all-android-armv6.apk differ
diff --git a/libs/jogamp-all-platforms/apk/jogl-test-android.apk b/libs/jogamp-all-platforms/apk/jogl-test-android.apk
new file mode 100644
index 00000000..158e35e7
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/jogl-test-android.apk differ
diff --git a/libs/jogamp-all-platforms/apk/unsigned/gluegen-rt-android-aarch64.apk b/libs/jogamp-all-platforms/apk/unsigned/gluegen-rt-android-aarch64.apk
new file mode 100644
index 00000000..aaa76ac0
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/unsigned/gluegen-rt-android-aarch64.apk differ
diff --git a/libs/jogamp-all-platforms/apk/unsigned/gluegen-rt-android-armv6.apk b/libs/jogamp-all-platforms/apk/unsigned/gluegen-rt-android-armv6.apk
new file mode 100644
index 00000000..7797a1fa
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/unsigned/gluegen-rt-android-armv6.apk differ
diff --git a/libs/jogamp-all-platforms/apk/unsigned/joal-android-aarch64.apk b/libs/jogamp-all-platforms/apk/unsigned/joal-android-aarch64.apk
new file mode 100644
index 00000000..0f3a42fa
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/unsigned/joal-android-aarch64.apk differ
diff --git a/libs/jogamp-all-platforms/apk/unsigned/joal-android-armv6.apk b/libs/jogamp-all-platforms/apk/unsigned/joal-android-armv6.apk
new file mode 100644
index 00000000..94c70e0a
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/unsigned/joal-android-armv6.apk differ
diff --git a/libs/jogamp-all-platforms/apk/unsigned/joal-test-android.apk b/libs/jogamp-all-platforms/apk/unsigned/joal-test-android.apk
new file mode 100644
index 00000000..cc8a1d70
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/unsigned/joal-test-android.apk differ
diff --git a/libs/jogamp-all-platforms/apk/unsigned/jocl-android-aarch64.apk b/libs/jogamp-all-platforms/apk/unsigned/jocl-android-aarch64.apk
new file mode 100644
index 00000000..0f320558
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/unsigned/jocl-android-aarch64.apk differ
diff --git a/libs/jogamp-all-platforms/apk/unsigned/jocl-android-armv6.apk b/libs/jogamp-all-platforms/apk/unsigned/jocl-android-armv6.apk
new file mode 100644
index 00000000..a24721a0
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/unsigned/jocl-android-armv6.apk differ
diff --git a/libs/jogamp-all-platforms/apk/unsigned/jocl-test-android.apk b/libs/jogamp-all-platforms/apk/unsigned/jocl-test-android.apk
new file mode 100644
index 00000000..4652b2ff
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/unsigned/jocl-test-android.apk differ
diff --git a/libs/jogamp-all-platforms/apk/unsigned/jogamp-android-launcher.apk b/libs/jogamp-all-platforms/apk/unsigned/jogamp-android-launcher.apk
new file mode 100644
index 00000000..ddb358ac
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/unsigned/jogamp-android-launcher.apk differ
diff --git a/libs/jogamp-all-platforms/apk/unsigned/jogl-all-android-aarch64.apk b/libs/jogamp-all-platforms/apk/unsigned/jogl-all-android-aarch64.apk
new file mode 100644
index 00000000..bbe5f6f1
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/unsigned/jogl-all-android-aarch64.apk differ
diff --git a/libs/jogamp-all-platforms/apk/unsigned/jogl-all-android-armv6.apk b/libs/jogamp-all-platforms/apk/unsigned/jogl-all-android-armv6.apk
new file mode 100644
index 00000000..d3c9fd10
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/unsigned/jogl-all-android-armv6.apk differ
diff --git a/libs/jogamp-all-platforms/apk/unsigned/jogl-test-android.apk b/libs/jogamp-all-platforms/apk/unsigned/jogl-test-android.apk
new file mode 100644
index 00000000..49487b8e
Binary files /dev/null and b/libs/jogamp-all-platforms/apk/unsigned/jogl-test-android.apk differ
diff --git a/libs/jogamp-all-platforms/etc/profile.jogl b/libs/jogamp-all-platforms/etc/profile.jogl
new file mode 100644
index 00000000..31cff13a
--- /dev/null
+++ b/libs/jogamp-all-platforms/etc/profile.jogl
@@ -0,0 +1,148 @@
+#! /bin/sh
+
+function print_usage()
+{
+ echo "Usage: $0 {JOGL_ALL|JOGL_ALL_NOAWT|JOGL_ALL_MOBILE} [jogl-build-dir]"
+}
+
+function concat_jogl_list()
+{
+ ITEMDIR="$1"
+ shift
+ for j in "$ITEMDIR" "$ITEMDIR"/jar ; do
+ for i in $* ; do
+ if [ -e "$j"/$i ] ; then
+ if [ -z "$JOGL_LIST" ] ; then
+ JOGL_LIST="$j"/$i
+ else
+ JOGL_LIST="$JOGL_LIST":"$j"/$i
+ fi
+ fi
+ done
+ done
+ echo $JOGL_LIST
+}
+
+ARCH=`uname -m`
+if [ "$ARCH" = "i86pc" ] ; then
+ ARCH="x86"
+fi
+
+KERNEL=`uname -s | awk ' { printf "%s",tolower($0) ; } '`
+if [ "$KERNEL" = "sunos" ] ; then
+ KERNEL="solaris"
+fi
+
+uname -a | grep -i LINUX && OSS=x11
+uname -a | grep -i Darwin && OSS=osx
+uname -a | grep -i CYGWIN && OSS=win
+
+JOGL_TEST="jogl-test.jar"
+
+JOGL_JAR_ALL="jogl-all.jar"
+JOGL_JAR_ALL_NOAWT="jogl-all-noawt.jar"
+JOGL_JAR_ALL_MOBILE="jogl-all-mobile.jar"
+JOGL_JAR_SWT="atomic/jogl-swt.jar"
+
+JOGL_JAR_OCULUSVR="atomic/oculusvr.jar"
+
+JOGL_LIB_ALL="libnativewindow_x11.so libnativewindow_awt.so libjogl_desktop.so libjogl_mobile.so libjogl_cg.so libnewt.so liboculusvr.so"
+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"
+
+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`
+
+JOGL_PROFILE="$1"
+shift
+
+if [ -z "$JOGL_PROFILE" ] ; then
+ echo JOGL PROFILE missing
+ print_usage
+fi
+
+JOGL_BUILD_DIR="$1"
+shift
+
+AUTOBUILD=0
+
+if [ ! -z "$JOGL_BUILD_DIR" -a -e "$JOGL_BUILD_DIR" ] ; then
+ AUTOBUILD=0
+elif [ -e "$THISDIR"/jar ] ; then
+ # Autobuild
+ JOGL_BUILD_DIR="$THISDIR"/jar
+ AUTOBUILD=1
+else
+ echo invalid JOGL_BUILD_DIR "$JOGL_BUILD_DIR" and no AUTOBUILD
+ print_usage
+fi
+export JOGL_BUILD_DIR
+
+JOGL_LIB_DIR="$JOGL_BUILD_DIR"/lib
+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_ATOMICS_NOAWT_CLASSPATH JOGL_SWT_CLASSPATH
+
+if [ ! -z "$JOGL_PROFILE" ] ; then
+ case "$JOGL_PROFILE" in
+ JOGL_ALL)
+ JOGL_CLASSPATH=$JOGL_ALL_AWT_CLASSPATH
+ ;;
+ JOGL_ALL_NOAWT)
+ JOGL_CLASSPATH=$JOGL_ALL_NOAWT_CLASSPATH
+ ;;
+ JOGL_ALL_MOBILE)
+ JOGL_CLASSPATH=$JOGL_MOBILE_CLASSPATH
+ ;;
+ esac
+else
+ JOGL_CLASSPATH=$JOGL_ALL_AWT_CLASSPATH
+fi
+export JOGL_CLASSPATH
+
+if [ "$KERNEL" = "linux" ] ; then
+ SWT_SUB="gtk"
+elif [ "$KERNEL" = "solaris" ] ; then
+ SWT_SUB="gtk"
+elif [ "$KERNEL" = "darwin" ] ; then
+ SWT_SUB="cocoa"
+ KERNEL="macosx"
+ ARCH="x86_64"
+fi
+if [ -z "$SWT_CLASSPATH" ] ; then
+ SWT_CLASSPATH_0=$JOGL_BUILD_DIR/../make/lib/swt/$SWT_SUB-$KERNEL-$ARCH/swt-debug.jar
+ SWT_CLASSPATH_1=$HOME/.java/swt.jar
+ if [ ! -e "$SWT_CLASSPATH_0" ] ; then
+ echo Info: NO JOGL SWT $SWT_CLASSPATH_0
+ if [ ! -e "$SWT_CLASSPATH_1" ] ; then
+ echo Info: NO Users SWT $SWT_CLASSPATH_1
+ else
+ export SWT_CLASSPATH=$SWT_CLASSPATH_1
+ echo Info: Using Users SWT $SWT_CLASSPATH
+ fi
+ else
+ export SWT_CLASSPATH=$SWT_CLASSPATH_0
+ echo Info: Using JOGL SWT $SWT_CLASSPATH
+ fi
+ if [ ! -z "$SWT_CLASSPATH" ] ; then
+ export SWT_CLASSPATH
+ fi
+fi
+
+if [ -z "$JOGL_CLASSPATH" ] ; then
+ print_usage
+fi
+
diff --git a/libs/jogamp-all-platforms/etc/test.bat b/libs/jogamp-all-platforms/etc/test.bat
new file mode 100644
index 00000000..ef924fb5
--- /dev/null
+++ b/libs/jogamp-all-platforms/etc/test.bat
@@ -0,0 +1,18 @@
+
+set BLD_DIR=jar
+
+set CP_ALL=.;%BLD_DIR%\gluegen-rt.jar;%BLD_DIR%\jogl-all.jar
+echo CP_ALL %CP_ALL%
+
+set X_ARGS="-Dsun.java2d.noddraw=true" "-Dsun.awt.noerasebackground=true"
+
+REM java -classpath %CP_ALL% %X_ARGS% com.jogamp.opengl.awt.GLCanvas > java-win64.log 2>&1
+
+REM java -classpath %CP_ALL% %X_ARGS% com.jogamp.common.GlueGenVersion > test.log 2>&1
+REM java -classpath %CP_ALL% %X_ARGS% com.jogamp.nativewindow.NativeWindowVersion >> test.log 2>&1
+REM java -classpath %CP_ALL% %X_ARGS% com.jogamp.opengl.JoglVersion >> test.log 2>&1
+REM java -classpath %CP_ALL% %X_ARGS% com.jogamp.newt.NewtVersion >> test.log 2>&1
+REM java -classpath %CP_ALL% %X_ARGS% com.jogamp.newt.opengl.GLCanvas >> test.log 2>&1
+java -classpath %CP_ALL% %X_ARGS% com.jogamp.newt.opengl.GLWindow >> test.log 2>&1
+
+type test.log
diff --git a/libs/jogamp-all-platforms/etc/test.sh b/libs/jogamp-all-platforms/etc/test.sh
new file mode 100644
index 00000000..3e5be122
--- /dev/null
+++ b/libs/jogamp-all-platforms/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/jogl-all.jar
+export CLASSPATH
+
+echo CLASSPATH: $CLASSPATH
+echo
+
+# D_ARGS="-Djogamp.debug=all -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all"
+#
+# 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 com.jogamp.common.GlueGenVersion 2>&1 | tee -a $logfile
+#java $X_ARGS $ARGS_AWT $D_ARGS com.jogamp.nativewindow.NativeWindowVersion 2>&1 | tee -a $logfile
+#java $X_ARGS $ARGS_AWT $D_ARGS com.jogamp.opengl.JoglVersion 2>&1 | tee -a $logfile
+#java $X_ARGS $ARGS_AWT $D_ARGS com.jogamp.newt.NewtVersion 2>&1 | tee -a $logfile
+#java $X_ARGS $ARGS_AWT $D_ARGS com.jogamp.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/libs/jogamp-all-platforms/etc/test_dbg.bat b/libs/jogamp-all-platforms/etc/test_dbg.bat
new file mode 100644
index 00000000..20969075
--- /dev/null
+++ b/libs/jogamp-all-platforms/etc/test_dbg.bat
@@ -0,0 +1,13 @@
+
+set BLD_DIR=jar
+
+set CP_ALL=.;%BLD_DIR%\gluegen-rt.jar;%BLD_DIR%\jogl-all.jar
+echo CP_ALL %CP_ALL%
+
+set D_ARGS="-Djogamp.debug=all" "-Dnativewindow.debug=all" "-Djogl.debug=all" "-Dnewt.debug=all"
+set X_ARGS="-Dsun.java2d.noddraw=true" "-Dsun.awt.noerasebackground=true"
+
+REM java -classpath %CP_ALL% %X_ARGS% %D_ARGS% com.jogamp.newt.opengl.GLCanvas >> test.log 2>&1
+java -classpath %CP_ALL% %X_ARGS% %D_ARGS% com.jogamp.newt.opengl.GLWindow >> test_dbg.log 2>&1
+
+type test_dbg.log
diff --git a/libs/jogamp-all-platforms/etc/test_dbg.sh b/libs/jogamp-all-platforms/etc/test_dbg.sh
new file mode 100644
index 00000000..7bfd5ee6
--- /dev/null
+++ b/libs/jogamp-all-platforms/etc/test_dbg.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/jogl-all.jar
+export CLASSPATH
+
+echo CLASSPATH: $CLASSPATH
+echo
+
+D_ARGS="-Djogamp.debug=all -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all"
+
+# 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 com.jogamp.common.GlueGenVersion 2>&1 | tee -a $logfile
+#java $X_ARGS $ARGS_AWT $D_ARGS com.jogamp.nativewindow.NativeWindowVersion 2>&1 | tee -a $logfile
+#java $X_ARGS $ARGS_AWT $D_ARGS com.jogamp.opengl.JoglVersion 2>&1 | tee -a $logfile
+#java $X_ARGS $ARGS_AWT $D_ARGS com.jogamp.newt.NewtVersion 2>&1 | tee -a $logfile
+#java $X_ARGS $ARGS_AWT $D_ARGS com.jogamp.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/libs/jogamp-all-platforms/gluegen-java-src.zip b/libs/jogamp-all-platforms/gluegen-java-src.zip
new file mode 100644
index 00000000..2d6a93c4
Binary files /dev/null and b/libs/jogamp-all-platforms/gluegen-java-src.zip differ
diff --git a/libs/jogamp-all-platforms/gluegen.LICENSE.txt b/libs/jogamp-all-platforms/gluegen.LICENSE.txt
new file mode 100644
index 00000000..1b21c36e
--- /dev/null
+++ b/libs/jogamp-all-platforms/gluegen.LICENSE.txt
@@ -0,0 +1,182 @@
+The GlueGen source code is mostly licensed under the New BSD 2-clause license,
+however it contains other licensed material as well.
+
+Other licensed material is compatible with the 'New BSD 2-Clause License',
+if not stated otherwise.
+
+'New BSD 2-Clause License' incompatible materials are optional, they are:
+
+ NONE
+
+Below you find a detailed list of licenses used in this project.
+
++++
+
+The content of folder 'make/lib' contains build-time only
+Java binaries (JAR) to ease the build setup.
+Each JAR file has it's corresponding LICENSE file containing the
+source location and license text. None of these binaries are contained in any way
+by the generated and deployed GlueGen binaries.
+
++++
+
+L.1) The GlueGen source tree contains code from the JogAmp Community
+ which is covered by the Simplified BSD 2-clause license:
+
+ Copyright 2010 JogAmp Community. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice, this list of
+ conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ of conditions and the following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ The views and conclusions contained in the software and documentation are those of the
+ authors and should not be interpreted as representing official policies, either expressed
+ or implied, of JogAmp Community.
+
+ You can address the JogAmp Community via:
+ Web http://jogamp.org/
+ Forum/Mailinglist http://jogamp.762907.n3.nabble.com/
+ Chatrooms
+ IRC irc.freenode.net #jogamp
+ Jabber conference.jabber.org room: jogamp (deprecated!)
+ Repository http://jogamp.org/git/
+ Email mediastream _at_ jogamp _dot_ org
+
+
+L.2) The GlueGen source tree contains code from Sun Microsystems, Inc.
+ which is covered by the New BSD 3-clause license:
+
+ Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ - Redistribution of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistribution in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ Neither the name of Sun Microsystems, Inc. or the names of
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ This software is provided "AS IS," without a warranty of any kind. ALL
+ EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+ You acknowledge that this software is not designed or intended for use
+ in the design, construction, operation or maintenance of any nuclear
+ facility.
+
+L.3) The GlueGen source tree contains CGRAM http://www.antlr.org/grammar/cgram/,
+ a ANSI-C parser implementation using ANTLR, which is being used
+ in the compile time part only.
+ It is covered by the Original BSD 4-clause license:
+
+ Copyright (c) 1998-2000, Non, Inc.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright
+ notice, this list of conditions, and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions, and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ All advertising materials mentioning features or use of this
+ software must display the following acknowledgement:
+
+ This product includes software developed by Non, Inc. and
+ its contributors.
+
+ Neither name of the company nor the names of its contributors
+ may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
+ IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COMPANY OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+A.1) The GlueGen source tree contains code from The Apache Software Foundation
+ which is covered by the Apache License Version 2.0
+
+ Apache Harmony - Open Source Java SE
+ =====================================
+
+
+
+ Author: The Apache Software Foundation (http://www.apache.org/).
+
+ Copyright 2006, 2010 The Apache Software Foundation.
+
+ Apache License Version 2.0, January 2004
+ http://www.apache.org/licenses/LICENSE-2.0
+ Or within this repository: doc/licenses/Apache.LICENSE-2.0
+
+ Files:
+ - src/java/com/jogamp/common/net/Uri.java
+ (derived from java.net.URI.Helper and heavily modified)
+
+A.2) The GlueGen source tree contains code from Ben Mankin, a.k.a 'Shevek',
+ which is covered by the Apache License Version 2.0
+
+ JCPP - A Java C Preprocessor
+ =============================
+
+
+
+
+ Author: Ben Mankin, a.k.a 'Shevek' (http://www.anarres.org/about/).
+
+ Copyright (c) 2007-2008, Shevek
+
+ Apache License Version 2.0, January 2004
+ http://www.apache.org/licenses/LICENSE-2.0
+ Or within this repository: doc/licenses/Apache.LICENSE-2.0
+
+ Files:
+ The complete git submodule 'jcpp',
+ which is a patched version of the original mentioned above.
+
+ Used for the compile-time module gluegen.jar only.
+
diff --git a/libs/jogamp-all-platforms/gluegen.artifact.properties b/libs/jogamp-all-platforms/gluegen.artifact.properties
new file mode 100644
index 00000000..581db565
--- /dev/null
+++ b/libs/jogamp-all-platforms/gluegen.artifact.properties
@@ -0,0 +1,5 @@
+gluegen.build.version=2.3.2
+gluegen.build.number=900
+gluegen.build.id=900
+gluegen.build.branch=origin/master
+gluegen.build.commit=cc1e9bc698b7f11097c1e114027e53121552f280
diff --git a/libs/jogamp-all-platforms/jnlp-files/Bug910-AppletLifecycleCheck.html b/libs/jogamp-all-platforms/jnlp-files/Bug910-AppletLifecycleCheck.html
new file mode 100644
index 00000000..eee6c1ee
--- /dev/null
+++ b/libs/jogamp-all-platforms/jnlp-files/Bug910-AppletLifecycleCheck.html
@@ -0,0 +1,32 @@
+
+
+
+Bug910 Extended AWT Applet Lifecycle Check
+
+
+
+
+The applet below tests the Applet Lifecycle.
+Please read the stderr log for results!
+
+
+Note that the jogl-test.jar, which contains the GearsES2 class,
+does not need to be signed! JogAmp Community signs
+jogl-all.jar and gluegen-rt.jar, which contain the
+JOGL's supporting classes; this is the only
+Java code which needs to be signed in order to deploy applets using
+JOGL and is the only certificate the end user must accept.
+
+Sadly, due to Oracle's Java Applet Plugin update 7u51,
+unsigned applets are no more allowed and effectively
+lower the bar to create user applets with raised privileges.
+Hence JogAmp Community signs jogl-all.jar and gluegen-rt.jar, which contain the
+JOGL's supporting classes as well as jogl-test.jar, which contains the users implementing Applet class.
+jogl-test.jar's manifest file uses Permissions: sandbox
+to not raise privileges.
+
m - toggle maximize, V, +shift H+V, +alt H, +ctrl off
+
p - position window to 100/100
+
r - in/out browser window (no modifiers)
+
r - toggle window resizable (any modifiers)
+
s - toggle window sticky
+
v - toggle window visibility, +shift: keep invisible
+
v - change swap-interval: 1, 0, -1, 1, .. (+ctrl)
+
w - warp mouse pointer to center
+
x - toggle surface pixel scale
+
+Normal webpage text - Normal webpage text - Normal webpage text - Normal webpage text
+Normal webpage text - Normal webpage text - Normal webpage text - Normal webpage text
+Normal webpage text - Normal webpage text - Normal webpage text - Normal webpage text
+Normal webpage text - Normal webpage text - Normal webpage text - Normal webpage text
+
+
+
+
+
diff --git a/libs/jogamp-all-platforms/jnlp-files/jogl-applet-runner-newt-gears-gl3-napplet.html b/libs/jogamp-all-platforms/jnlp-files/jogl-applet-runner-newt-gears-gl3-napplet.html
new file mode 100644
index 00000000..d16a7865
--- /dev/null
+++ b/libs/jogamp-all-platforms/jnlp-files/jogl-applet-runner-newt-gears-gl3-napplet.html
@@ -0,0 +1,128 @@
+
+
+
+JOGL NEWT Applet Runner - GearsES2 - GL3 Core - (NApplet)
+
+
+
+
+
+Note that the jogl-test.jar, which contains the GearsES2 class,
+does not need to be signed! JogAmp Community signs
+jogl-all.jar and gluegen-rt.jar, which contain the
+JOGL's supporting classes; this is the only
+Java code which needs to be signed in order to deploy applets using
+JOGL and is the only certificate the end user must accept.
+
+Sadly, due to Oracle's Java Applet Plugin update 7u51,
+unsigned applets are no more allowed and effectively
+lower the bar to create user applets with raised privileges.
+Hence JogAmp Community signs jogl-all.jar and gluegen-rt.jar, which contain the
+JOGL's supporting classes as well as jogl-test.jar, which contains the users implementing Applet class.
+jogl-test.jar's manifest file uses Permissions: sandbox
+to not raise privileges.
+
+
+Note that the jogl-test.jar, which contains the GearsES2 class,
+does not need to be signed! JogAmp Community signs
+jogl-all.jar and gluegen-rt.jar, which contain the
+JOGL's supporting classes; this is the only
+Java code which needs to be signed in order to deploy applets using
+JOGL and is the only certificate the end user must accept.
+
+Sadly, due to Oracle's Java Applet Plugin update 7u51,
+unsigned applets are no more allowed and effectively
+lower the bar to create user applets with raised privileges.
+Hence JogAmp Community signs jogl-all.jar and gluegen-rt.jar, which contain the
+JOGL's supporting classes as well as jogl-test.jar, which contains the users implementing Applet class.
+jogl-test.jar's manifest file uses Permissions: sandbox
+to not raise privileges.
+
+
+Note that the jogl-test.jar, which contains the GearsES2 class,
+does not need to be signed! JogAmp Community signs
+jogl-all.jar and gluegen-rt.jar, which contain the
+JOGL's supporting classes; this is the only
+Java code which needs to be signed in order to deploy applets using
+JOGL and is the only certificate the end user must accept.
+
+Sadly, due to Oracle's Java Applet Plugin update 7u51,
+unsigned applets are no more allowed and effectively
+lower the bar to create user applets with raised privileges.
+Hence JogAmp Community signs jogl-all.jar and gluegen-rt.jar, which contain the
+JOGL's supporting classes as well as jogl-test.jar, which contains the users implementing Applet class.
+jogl-test.jar's manifest file uses Permissions: sandbox
+to not raise privileges.
+
+Note that it is important for the startup time to have the same JVM arguments in the applet tags,
+as well as within the JNLP applet description.
+Only if JVM arguments of the JNLP applet description are satisfied by the applet tag's JVM,
+the plugin will not need to start a new JVM. OF course, the applet tag's JVM spec may exceed the
+JNLP applet's one.
+
+
+
+JOGL NEWT JNLP Applet Runner Special Keys:
+
+
SPACE - pause/resume animator
+
a - on/off always-on-top
+
b - on/off always-on-bottom
+
c - change mouse pointer
+
d - toggle decoration
+
f - toggle fullscreen
+
g - increase gamma, +shift decreases
+
i - toggle mouse pointer visibility
+
j - toggle confine mouse pointer
+
m - toggle maximize, V, +shift H+V, +alt H, +ctrl off
+
p - position window to 100/100
+
r - in/out browser window (no modifiers)
+
r - toggle window resizable (any modifiers)
+
s - toggle window sticky
+
v - toggle window visibility, +shift: keep invisible
+
v - change swap-interval: 1, 0, -1, 1, .. (+ctrl)
+
w - warp mouse pointer to center
+
x - toggle surface pixel scale
+
+
+
+
+
+
+
+
+
+The applet above is instantiated with the following code:
+
+
+
+Note that the jogl-test.jar, which contains the GearsES2 class,
+does not need to be signed! JogAmp Community signs
+jogl-all.jar and gluegen-rt.jar, which contain the
+JOGL's supporting classes; this is the only
+Java code which needs to be signed in order to deploy applets using
+JOGL and is the only certificate the end user must accept.
+
+Sadly, due to Oracle's Java Applet Plugin update 7u51,
+unsigned applets are no more allowed and effectively
+lower the bar to create user applets with raised privileges.
+Hence JogAmp Community signs jogl-all.jar and gluegen-rt.jar, which contain the
+JOGL's supporting classes as well as jogl-test.jar, which contains the users implementing Applet class.
+jogl-test.jar's manifest file uses Permissions: sandbox
+to not raise privileges.
+
m - toggle maximize, V, +shift H+V, +alt H, +ctrl off
+
p - position window to 100/100
+
r - in/out browser window (no modifiers)
+
r - toggle window resizable (any modifiers)
+
s - toggle window sticky
+
v - toggle window visibility, +shift: keep invisible
+
v - change swap-interval: 1, 0, -1, 1, .. (+ctrl)
+
w - warp mouse pointer to center
+
x - toggle surface pixel scale
+
+Normal webpage text - Normal webpage text - Normal webpage text - Normal webpage text
+Normal webpage text - Normal webpage text - Normal webpage text - Normal webpage text
+Normal webpage text - Normal webpage text - Normal webpage text - Normal webpage text
+Normal webpage text - Normal webpage text - Normal webpage text - Normal webpage text
+
+
+
+
+
diff --git a/libs/jogamp-all-platforms/jnlp-files/jogl-applet-runner-newt-gears-special.html b/libs/jogamp-all-platforms/jnlp-files/jogl-applet-runner-newt-gears-special.html
new file mode 100644
index 00000000..361f8e3e
--- /dev/null
+++ b/libs/jogamp-all-platforms/jnlp-files/jogl-applet-runner-newt-gears-special.html
@@ -0,0 +1,83 @@
+
+
+
+JOGL NEWT JNLP Applet Runner - GearsES2 - special
+
+
+
+
m - toggle maximize, V, +shift H+V, +alt H, +ctrl off
+
p - position window to 100/100
+
r - in/out browser window (no modifiers)
+
r - toggle window resizable (any modifiers)
+
s - toggle window sticky
+
v - toggle window visibility, +shift: keep invisible
+
v - change swap-interval: 1, 0, -1, 1, .. (+ctrl)
+
w - warp mouse pointer to center
+
x - toggle surface pixel scale
+
+Normal webpage text - Normal webpage text - Normal webpage text - Normal webpage text
+Normal webpage text - Normal webpage text - Normal webpage text - Normal webpage text
+Normal webpage text - Normal webpage text - Normal webpage text - Normal webpage text
+Normal webpage text - Normal webpage text - Normal webpage text - Normal webpage text
+
+
+
+
+
diff --git a/libs/jogamp-all-platforms/jnlp-files/jogl-applet-runner-newt.jnlp b/libs/jogamp-all-platforms/jnlp-files/jogl-applet-runner-newt.jnlp
new file mode 100644
index 00000000..62e0942a
--- /dev/null
+++ b/libs/jogamp-all-platforms/jnlp-files/jogl-applet-runner-newt.jnlp
@@ -0,0 +1,25 @@
+
+
+
+ JOGL JNLP Applet Runner NEWT
+ JogAmp Community
+
+ JOGL JNLP Applet Runner NEWT
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/libs/jogamp-all-platforms/jnlp-files/jogl-applet-version-applet3-napplet.html b/libs/jogamp-all-platforms/jnlp-files/jogl-applet-version-applet3-napplet.html
new file mode 100644
index 00000000..d10e1dc5
--- /dev/null
+++ b/libs/jogamp-all-platforms/jnlp-files/jogl-applet-version-applet3-napplet.html
@@ -0,0 +1,57 @@
+
+
+
+JOGL JNLP Applet3 Version (NApplet)
+
+
+
+
+The applet3 below shall show you the version of the Jogl components
+and your platform.
+
+
+
+
+
+
+
+
+
+The applet3 above is instantiated with the following code:
+
+
+ * JOGL2 OpenGL ES 2 demo to expose and learn what the RAW OpenGL ES 2 API looks like.
+ *
+ * Compile, run and enjoy:
+ wget http://jogamp.org/deployment/jogamp-current/archive/jogamp-all-platforms.7z
+ 7z x jogamp-all-platforms.7z
+ cd jogamp-all-platforms
+ mkdir -p demos/es2
+ cd demos/es2
+ wget https://raw.github.com/xranby/jogl-demos/master/src/demos/es2/RawGL2ES2demo.java
+ cd ../..
+ javac -cp jar/jogl-all.jar:jar/gluegen-rt.jar demos/es2/RawGL2ES2demo.java
+ java -cp jar/jogl-all.jar:jar/gluegen-rt.jar:. demos.es2.RawGL2ES2demo
+ *
+ *
+ *
+ * @author Xerxes Rånby (xranby)
+ */
+
+public class CalculatorWindow implements GLEventListener{
+
+/* Introducing the OpenGL ES 2 Vertex shader
+ *
+ * The main loop inside the vertex shader gets executed
+ * one time for each vertex.
+ *
+ * vertex -> * uniform data -> mat4 projection = ( 1, 0, 0, 0,
+ * (0,1,0) / \ 0, 1, 0, 0,
+ * / . \ <- origo (0,0,0) 0, 0, 1, 0,
+ * / \ 0, 0,-1, 1 );
+ * vertex -> *-------* <- vertex
+ * (-1,-1,0) (1,-1,0) <- attribute data can be used
+ * (0, 0,1) for color, position, normals etc.
+ *
+ * The vertex shader recive input data in form of
+ * "uniform" data that are common to all vertex
+ * and
+ * "attribute" data that are individual to each vertex.
+ * One vertex can have several "attribute" data sources enabled.
+ *
+ * The vertex shader produce output used by the fragment shader.
+ * gl_Position are expected to get set to the final vertex position.
+ * You can also send additional user defined
+ * "varying" data to the fragment shader.
+ *
+ * Model Translate, Scale and Rotate are done here by matrix-multiplying a
+ * projection matrix against each vertex position.
+ *
+ * The whole vertex shader program are a String containing GLSL ES language
+ * http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf
+ * sent to the GPU driver for compilation.
+ */
+private String vertexShaderString =
+// For GLSL 1 and 1.1 code i highly recomend to not include a
+// GLSL ES language #version line, GLSL ES section 3.4
+// Many GPU drivers refuse to compile the shader if #version is different from
+// the drivers internal GLSL version.
+//
+// This demo use GLSL version 1.1 (the implicit version)
+
+"#if __VERSION__ >= 130\n" + // GLSL 130+ uses in and out
+" #define attribute in\n" + // instead of attribute and varying
+" #define varying out\n" + // used by OpenGL 3 core and later.
+"#endif\n" +
+
+"#ifdef GL_ES \n" +
+"precision mediump float; \n" + // Precision Qualifiers
+"precision mediump int; \n" + // GLSL ES section 4.5.2
+"#endif \n" +
+
+"uniform mat4 uniform_Projection; \n" + // Incomming data used by
+"attribute vec4 attribute_Position; \n" + // the vertex shader
+"attribute vec4 attribute_Color; \n" + // uniform and attributes
+"attribute vec2 a_TexCoordinate; \n" +
+
+"varying vec2 v_TexCoordinate; \n" +
+"varying vec4 varying_Color; \n" + // Outgoing varying data
+ // sent to the fragment shader
+"void main(void) \n" +
+"{ \n" +
+" varying_Color = attribute_Color; \n" +
+" v_TexCoordinate = a_TexCoordinate; \n" +
+" gl_Position = uniform_Projection * attribute_Position; \n" +
+"} ";
+
+/* Introducing the OpenGL ES 2 Fragment shader
+ *
+ * The main loop of the fragment shader gets executed for each visible
+ * pixel fragment on the render buffer.
+ *
+ * vertex-> *
+ * (0,1,-1) /f\
+ * /ffF\ <- This fragment F gl_FragCoord get interpolated
+ * /fffff\ to (0.25,0.25,-1) based on the
+ * vertex-> *fffffff* <-vertex three vertex gl_Position.
+ * (-1,-1,-1) (1,-1,-1)
+ *
+ *
+ * All incomming "varying" and gl_FragCoord data to the fragment shader
+ * gets interpolated based on the vertex positions.
+ *
+ * The fragment shader produce and store the final color data output into
+ * gl_FragColor.
+ *
+ * Is up to you to set the final colors and calculate lightning here based on
+ * supplied position, color and normal data.
+ *
+ * The whole fragment shader program are a String containing GLSL ES language
+ * http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf
+ * sent to the GPU driver for compilation.
+ */
+private String fragmentShaderString =
+"#if __VERSION__ >= 130\n" +
+" #define varying in\n" +
+" out vec4 mgl_FragColor;\n" +
+" #define texture2D texture\n" +
+" #define gl_FragColor mgl_FragColor\n" +
+"#endif\n" +
+
+"#ifdef GL_ES \n" +
+"precision mediump float; \n" +
+"precision mediump int; \n" +
+"#endif \n" +
+
+"uniform sampler2D u_Texture; \n" +
+
+"varying vec2 v_TexCoordinate; \n" +
+"varying vec4 varying_Color; \n" + //incomming varying data to the
+ //frament shader
+ //sent from the vertex shader
+"void main (void) \n" +
+"{ \n" +
+
+" gl_FragColor = (varying_Color * texture2D(u_Texture, v_TexCoordinate));" +
+"} ";
+
+
+FloatBuffer fbVertices = Buffers.newDirectFloatBuffer(2000*18); // max 2000 quadrati
+FloatBuffer fbColors = Buffers.newDirectFloatBuffer(2000*24); // max 2000 quadrati
+FloatBuffer fbTextureCoordinates = Buffers.newDirectFloatBuffer(2000*12); // max 2000 quadrati
+final Texture[] texture = new Texture[1];
+final int[] textureHandle = new int[1];
+
+private final Display disp;
+public CalculatorWindow(Display disp) {
+ this.disp = disp;
+}
+
+ /* Introducing projection matrix helper functions
+ *
+ * OpenGL ES 2 vertex projection transformations gets applied inside the
+ * vertex shader, all you have to do are to calculate and supply a projection matrix.
+ *
+ * Its recomended to use the com/jogamp/opengl/util/PMVMatrix.java
+ * import com.jogamp.opengl.util.PMVMatrix;
+ * To simplify all your projection model view matrix creation needs.
+ *
+ * These helpers here are based on PMVMatrix code and common linear
+ * algebra for matrix multiplication, translate and rotations.
+ */
+ private void glMultMatrixf(FloatBuffer a, FloatBuffer b, FloatBuffer d) {
+ final int aP = a.position();
+ final int bP = b.position();
+ final int dP = d.position();
+ for (int i = 0; i < 4; i++) {
+ final float ai0=a.get(aP+i+0*4), ai1=a.get(aP+i+1*4), ai2=a.get(aP+i+2*4), ai3=a.get(aP+i+3*4);
+ d.put(dP+i+0*4 , ai0 * b.get(bP+0+0*4) + ai1 * b.get(bP+1+0*4) + ai2 * b.get(bP+2+0*4) + ai3 * b.get(bP+3+0*4) );
+ d.put(dP+i+1*4 , ai0 * b.get(bP+0+1*4) + ai1 * b.get(bP+1+1*4) + ai2 * b.get(bP+2+1*4) + ai3 * b.get(bP+3+1*4) );
+ d.put(dP+i+2*4 , ai0 * b.get(bP+0+2*4) + ai1 * b.get(bP+1+2*4) + ai2 * b.get(bP+2+2*4) + ai3 * b.get(bP+3+2*4) );
+ d.put(dP+i+3*4 , ai0 * b.get(bP+0+3*4) + ai1 * b.get(bP+1+3*4) + ai2 * b.get(bP+2+3*4) + ai3 * b.get(bP+3+3*4) );
+ }
+ }
+
+ private float[] multiply(float[] a,float[] b){
+ float[] tmp = new float[16];
+ glMultMatrixf(FloatBuffer.wrap(a),FloatBuffer.wrap(b),FloatBuffer.wrap(tmp));
+ return tmp;
+ }
+
+ private float[] translate(float[] m,float x,float y,float z){
+ float[] t = { 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ x, y, z, 1.0f };
+ return multiply(m, t);
+ }
+
+ private float[] rotate(float[] m,float a,float x,float y,float z){
+ float s, c;
+ s = (float)Math.sin(Math.toRadians(a));
+ c = (float)Math.cos(Math.toRadians(a));
+ float[] r = {
+ x * x * (1.0f - c) + c, y * x * (1.0f - c) + z * s, x * z * (1.0f - c) - y * s, 0.0f,
+ x * y * (1.0f - c) - z * s, y * y * (1.0f - c) + c, y * z * (1.0f - c) + x * s, 0.0f,
+ x * z * (1.0f - c) + y * s, y * z * (1.0f - c) - x * s, z * z * (1.0f - c) + c, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f };
+ return multiply(m, r);
+ }
+
+/* Introducing the GL2ES2 demo
+ *
+ * How to render a triangle using ~500 lines of code using the RAW
+ * OpenGL ES 2 API.
+ * The Programmable pipeline in OpenGL ES 2 are both fast and flexible
+ * yet it do take some extra lines of code to setup.
+ *
+ */
+ private double t0 = System.currentTimeMillis();
+ private double theta;
+ private double s;
+
+ private static int width=1920;
+ private static int height=1080;
+
+ private int shaderProgram;
+ private int vertShader;
+ private int fragShader;
+ private int ModelViewProjectionMatrixHandle;
+ private int mTextureUniformHandle;
+ private int mTextureCoordinateHandle;
+ private final int mTextureCoordinateDataSize = 2;
+ private int mTextureDataHandle;
+ static final int COLOR_IDX = 0;
+ static final int VERTICES_IDX = 1;
+ static final int TEXTURE_IDX = 2;
+ int[] vboHandles;
+
+ public GLWindow window;
+
+ public void create(){
+ /* This demo are based on the GL2ES2 GLProfile that uses common hardware acceleration
+ * functionality of desktop OpenGL 3, 2 and mobile OpenGL ES 2 devices.
+ * JogAmp JOGL will probe all the installed libGL.so, libEGL.so and libGLESv2.so librarys on
+ * the system to find which one provide hardware acceleration for your GPU device.
+ * Its common to find more than one version of these librarys installed on a system.
+ * For example on a ARM Linux system JOGL may find
+ * Hardware accelerated Nvidia tegra GPU drivers in: /usr/lib/nvidia-tegra/libEGL.so
+ * Software rendered Mesa Gallium driver in: /usr/lib/arm-linux-gnueabi/mesa-egl/libEGL.so.1
+ * Software rendered Mesa X11 in: /usr/lib/arm-linux-gnueabi/mesa/libGL.so
+ * Good news!: JOGL does all this probing for you all you have to do are to ask for
+ * the GLProfile you want to use.
+ */
+
+ GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
+ // We may at this point tweak the caps and request a translucent drawable
+ caps.setBackgroundOpaque(false);
+ GLWindow glWindow = GLWindow.create(caps);
+ window = glWindow;
+
+ /* You may combine the NEWT GLWindow inside existing Swing and AWT
+ * applications by encapsulating the glWindow inside a
+ * com.jogamp.newt.awt.NewtCanvasAWT canvas.
+ *
+ * NewtCanvasAWT newtCanvas = new NewtCanvasAWT(glWindow);
+ * JFrame frame = new JFrame("RAW GL2ES2 Demo inside a JFrame!");
+ * frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+ * frame.setSize(width,height);
+ * frame.add(newtCanvas);
+ * // add some swing code if you like.
+ * // javax.swing.JButton b = new javax.swing.JButton();
+ * // b.setText("Hi");
+ * // frame.add(b);
+ * frame.setVisible(true);
+ */
+
+ // In this demo we prefer to setup and view the GLWindow directly
+ // this allows the demo to run on -Djava.awt.headless=true systems
+ glWindow.setTitle("Raw GL2ES2 Demo");
+
+ // Finally we connect the GLEventListener application code to the NEWT GLWindow.
+ // GLWindow will call the GLEventListener init, reshape, display and dispose
+ // functions when needed.
+ glWindow.addGLEventListener(this /* GLEventListener */);
+ Animator animator = new Animator();
+ animator.add(glWindow);
+ animator.start();
+ }
+
+ public void init(GLAutoDrawable drawable) {
+ GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+ System.err.println("Chosen GLCapabilities: " + drawable.getChosenGLCapabilities());
+ System.err.println("INIT GL IS: " + gl.getClass().getName());
+ System.err.println("GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
+ System.err.println("GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER));
+ System.err.println("GL_VERSION: " + gl.glGetString(GL.GL_VERSION));
+
+ /* The initialization below will use the OpenGL ES 2 API directly
+ * to setup the two shader programs that will be run on the GPU.
+ *
+ * Its recommended to use the jogamp/opengl/util/glsl/ classes
+ * import com.jogamp.opengl.util.glsl.ShaderCode;
+ * import com.jogamp.opengl.util.glsl.ShaderProgram;
+ * import com.jogamp.opengl.util.glsl.ShaderState;
+ * to simplify shader customization, compile and loading.
+ *
+ * You may also want to look at the JOGL RedSquareES2 demo
+ * http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareES2.java;hb=HEAD#l78
+ * to see how the shader customization, compile and loading is done
+ * using the recommended JogAmp GLSL utility classes.
+ */
+
+ // Make the shader strings compatible with OpenGL 3 core if needed
+ // GL2ES2 also includes the intersection of GL3 core
+ // The default implicit GLSL version 1.1 is now depricated in GL3 core
+ // GLSL 1.3 is the minimum version that now has to be explicitly set.
+ // This allows the shaders to compile using the latest
+ // desktop OpenGL 3 and 4 drivers.
+ if(gl.isGL3core()){
+ System.out.println("GL3 core detected: explicit add #version 130 to shaders");
+ vertexShaderString = "#version 130\n"+vertexShaderString;
+ fragmentShaderString = "#version 130\n"+fragmentShaderString;
+ }
+
+ // Create GPU shader handles
+ // OpenGL ES retuns a index id to be stored for future reference.
+ vertShader = gl.glCreateShader(GL2ES2.GL_VERTEX_SHADER);
+ fragShader = gl.glCreateShader(GL2ES2.GL_FRAGMENT_SHADER);
+
+ //Generate textures
+ gl.glGenTextures(1, textureHandle, 0);
+
+ try {
+ Texture t = loadTexture("test.png");
+ textureHandle[0] = t.getTarget();
+ texture[0] = t;
+ gl.glBindTexture(GL2ES2.GL_TEXTURE_2D, textureHandle[0]);
+ } catch (GLException | IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ //Compile the vertexShader String into a program.
+ String[] vlines = new String[] { vertexShaderString };
+ int[] vlengths = new int[] { vlines[0].length() };
+ gl.glShaderSource(vertShader, vlines.length, vlines, vlengths, 0);
+ gl.glCompileShader(vertShader);
+
+ //Check compile status.
+ int[] compiled = new int[1];
+ gl.glGetShaderiv(vertShader, GL2ES2.GL_COMPILE_STATUS, compiled,0);
+ if(compiled[0]!=0){System.out.println("Horray! vertex shader compiled");}
+ else {
+ int[] logLength = new int[1];
+ gl.glGetShaderiv(vertShader, GL2ES2.GL_INFO_LOG_LENGTH, logLength, 0);
+
+ byte[] log = new byte[logLength[0]];
+ gl.glGetShaderInfoLog(vertShader, logLength[0], (int[])null, 0, log, 0);
+
+ System.err.println("Error compiling the vertex shader: " + new String(log));
+ System.exit(1);
+ }
+
+ //Compile the fragmentShader String into a program.
+ String[] flines = new String[] { fragmentShaderString };
+ int[] flengths = new int[] { flines[0].length() };
+ gl.glShaderSource(fragShader, flines.length, flines, flengths, 0);
+ gl.glCompileShader(fragShader);
+
+ //Check compile status.
+ gl.glGetShaderiv(fragShader, GL2ES2.GL_COMPILE_STATUS, compiled,0);
+ if(compiled[0]!=0){System.out.println("Horray! fragment shader compiled");}
+ else {
+ int[] logLength = new int[1];
+ gl.glGetShaderiv(fragShader, GL2ES2.GL_INFO_LOG_LENGTH, logLength, 0);
+
+ byte[] log = new byte[logLength[0]];
+ gl.glGetShaderInfoLog(fragShader, logLength[0], (int[])null, 0, log, 0);
+
+ System.err.println("Error compiling the fragment shader: " + new String(log));
+ System.exit(1);
+ }
+
+ //Each shaderProgram must have
+ //one vertex shader and one fragment shader.
+ shaderProgram = gl.glCreateProgram();
+ gl.glAttachShader(shaderProgram, vertShader);
+ gl.glAttachShader(shaderProgram, fragShader);
+
+ //Associate attribute ids with the attribute names inside
+ //the vertex shader.
+ gl.glBindAttribLocation(shaderProgram, 0, "attribute_Position");
+ gl.glBindAttribLocation(shaderProgram, 1, "attribute_Color");
+ gl.glBindAttribLocation(shaderProgram, 2, "a_TexCoordinate");
+
+ gl.glLinkProgram(shaderProgram);
+
+ //Get a id number to the uniform_Projection matrix
+ //so that we can update it.
+ ModelViewProjectionMatrixHandle = gl.glGetUniformLocation(shaderProgram, "uniform_Projection");
+ mTextureUniformHandle = gl.glGetUniformLocation(shaderProgram, "u_Texture");
+ mTextureCoordinateHandle = gl.glGetAttribLocation(shaderProgram, "a_TexCoordinate");
+
+ /* GL2ES2 also includes the intersection of GL3 core
+ * GL3 core and later mandates that a "Vector Buffer Object" must
+ * be created and bound before calls such as gl.glDrawArrays is used.
+ * The VBO lines in this demo makes the code forward compatible with
+ * OpenGL 3 and ES 3 core and later where a default
+ * vector buffer object is deprecated.
+ *
+ * Generate two VBO pointers / handles
+ * VBO is data buffers stored inside the graphics card memory.
+ */
+ vboHandles = new int[3];
+ gl.glGenBuffers(3, vboHandles, 0);
+
+
+ }
+
+ public void reshape(GLAutoDrawable drawable, int x, int y, int z, int h) {
+ System.out.println("Window resized to width=" + z + " height=" + h);
+ width = z;
+ height = h;
+
+ // Get gl
+ GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+ // Optional: Set viewport
+ // Render to a square at the center of the window.
+ gl.glViewport((width-height)/2,0,height,height);
+ }
+
+ public void display(GLAutoDrawable drawable) {
+ // Update variables used in animation
+ double t1 = System.currentTimeMillis();
+ theta += (t1-t0)*0.005f;
+ t0 = t1;
+ s = Math.sin(theta);
+
+ // Get gl
+ GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+ // Clear screen
+ gl.glClearColor(0, 0, 0, 0f); // Purple
+ gl.glClear(GL2ES2.GL_STENCIL_BUFFER_BIT |
+ GL2ES2.GL_COLOR_BUFFER_BIT |
+ GL2ES2.GL_DEPTH_BUFFER_BIT );
+
+ // Use the shaderProgram that got linked during the init part.
+ gl.glUseProgram(shaderProgram);
+
+ /* Change a projection matrix
+ * The matrix multiplications and OpenGL ES2 code below
+ * basically match this OpenGL ES1 code.
+ * note that the model_view_projection matrix gets sent to the vertexShader.
+ *
+ * gl.glLoadIdentity();
+ * gl.glTranslatef(0.0f,0.0f,-0.1f);
+ * gl.glRotatef((float)30f*(float)s,1.0f,0.0f,1.0f);
+ *
+ */
+
+ // Set the active texture unit to texture unit 0.
+ gl.glActiveTexture(textureHandle[0]);
+
+ // Bind the texture to this unit.
+ gl.glBindTexture(GL2ES2.GL_TEXTURE_2D, mTextureDataHandle);
+
+ // Tell the texture uniform sampler to use this texture in the shader by binding to texture unit 0.
+ gl.glUniform1i(mTextureUniformHandle, 0);
+
+ float[] model_view_projection;
+ float[] identity_matrix = {
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f,
+ };
+ model_view_projection = identity_matrix;
+// model_view_projection = rotate(model_view_projection,30f*(float)s,1.0f,0.0f,1.0f);
+// model_view_projection = translate(model_view_projection,-0.5f,-0.5f, 0f);
+
+ // Send the final projection matrix to the vertex shader by
+ // using the uniform location id obtained during the init part.
+ gl.glUniformMatrix4fv(ModelViewProjectionMatrixHandle, 1, false, model_view_projection, 0);
+
+ /*
+ * Render a triangle:
+ * The OpenGL ES2 code below basically match this OpenGL code.
+ *
+ * gl.glBegin(GL_TRIANGLES); // Drawing Using Triangles
+ * gl.glVertex3f( 0.0f, 1.0f, 0.0f); // Top
+ * gl.glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left
+ * gl.glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right
+ * gl.glEnd(); // Finished Drawing The Triangle
+ */
+
+ fbVertices.clear();
+ fbColors.clear();
+ fbTextureCoordinates.clear();
+
+ fbVertices.put(new float[]{
+ 0.0f, 0.0f, 0.0f, //Top
+ 1.0f, 1.0f, 0.0f, //Bottom Left
+ 0.0f, 1.0f, 0.0f, //Bottom Right
+ });
+ fbColors.put(new float[]{
+ 1.0f, 0.0f, 0.0f, 1.0f, //Top color (red)
+ 0.0f, 0.0f, 0.0f, 1.0f, //Bottom Left color (black)
+ 1.0f, 1.0f, 0.0f, 1.0f, //Bottom Right color (yellow)
+ });
+ fbTextureCoordinates.put(new float[]{
+ 0.0f, 0.0f,
+ 0.0f, 1.0f,
+ 1.0f, 0.0f,
+ });
+ fbVertices.put(new float[]{
+ 0.0f, 0.0f, 0.0f,
+ 1.0f, 0.0f, 0.0f,
+ 1.0f, 1.0f, 0.0f});
+ fbColors.put(new float[]{
+ 1.0f, 0.0f, 0.0f, 1.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f,
+ 1.0f, 1.0f, 1.0f, 1.0f});
+ fbTextureCoordinates.put(new float[]{
+ 0.0f, 1.0f,
+ 1.0f, 1.0f,
+ 1.0f, 0.0f,
+ });
+ fbColors.position(0);
+ fbVertices.position(0);
+ fbTextureCoordinates.position(0);
+ int numTriangles = fbVertices.limit()/9;
+
+ // Select the VBO, GPU memory data, to use for vertices
+ gl.glBindBuffer(GL2ES2.GL_ARRAY_BUFFER, vboHandles[VERTICES_IDX]);
+
+ // transfer data to VBO, this perform the copy of data from CPU -> GPU memory
+ int numBytes = numTriangles * 9 * 4;
+ gl.glBufferData(GL.GL_ARRAY_BUFFER, numBytes, fbVertices, GL.GL_STATIC_DRAW);
+
+ // Associate Vertex attribute 0 with the last bound VBO
+ gl.glVertexAttribPointer(0 /* the vertex attribute */, 3,
+ GL2ES2.GL_FLOAT, false /* normalized? */, 0 /* stride */,
+ 0 /* The bound VBO data offset */);
+
+ // VBO
+ // gl.glBindBuffer(GL2ES2.GL_ARRAY_BUFFER, 0); // You can unbind the VBO after it have been associated using glVertexAttribPointer
+
+ gl.glEnableVertexAttribArray(0);
+
+ // Select the VBO, GPU memory data, to use for colors
+ gl.glBindBuffer(GL2ES2.GL_ARRAY_BUFFER, vboHandles[COLOR_IDX]);
+
+ numBytes = numTriangles * 12 * 4;
+ gl.glBufferData(GL.GL_ARRAY_BUFFER, numBytes, fbColors, GL.GL_STATIC_DRAW);
+
+ // Associate Vertex attribute 1 with the last bound VBO
+ gl.glVertexAttribPointer(1 /* the color attribute */, 4 /* four possitions used for each vertex */,
+ GL2ES2.GL_FLOAT, false /* normalized? */, 0 /* stride */,
+ 0 /* The bound VBO data offset */);
+
+ gl.glEnableVertexAttribArray(1);
+
+ // Select the VBO, GPU memory data, to use for texture
+ gl.glBindBuffer(GL2ES2.GL_ARRAY_BUFFER, vboHandles[TEXTURE_IDX]);
+
+ numBytes = numTriangles * 6 * 4;
+ gl.glBufferData(GL.GL_ARRAY_BUFFER, numBytes, fbTextureCoordinates, GL.GL_STATIC_DRAW);
+
+ // Associate Vertex attribute 1 with the last bound VBO
+ gl.glVertexAttribPointer(mTextureCoordinateHandle /* the texture attribute */, 2 /* two possitions used for each coordinate */,
+ GL2ES2.GL_FLOAT, false /* normalized? */, 0 /* stride */,
+ 0 /* The bound VBO data offset */);
+
+ gl.glEnableVertexAttribArray(mTextureCoordinateHandle);
+
+
+ gl.glDrawArrays(GL2ES2.GL_TRIANGLES, 0, numTriangles*3); //Draw the vertices as triangle
+
+ gl.glDisableVertexAttribArray(0); // Allow release of vertex position memory
+ gl.glDisableVertexAttribArray(1); // Allow release of vertex color memory
+ gl.glDisableVertexAttribArray(mTextureCoordinateHandle); // Allow release of vertex texture memory
+
+// disp.di
+ }
+
+ public void drawQuad() {
+
+ }
+
+ public void dispose(GLAutoDrawable drawable){
+ System.out.println("cleanup, remember to release shaders");
+ GL2ES2 gl = drawable.getGL().getGL2ES2();
+ gl.glUseProgram(0);
+ gl.glDeleteBuffers(3, vboHandles, 0); // Release VBO, color and vertices, buffer GPU memory.
+ vboHandles = null;
+ gl.glDetachShader(shaderProgram, vertShader);
+ gl.glDeleteShader(vertShader);
+ gl.glDetachShader(shaderProgram, fragShader);
+ gl.glDeleteShader(fragShader);
+ gl.glDeleteProgram(shaderProgram);
+ System.exit(0);
+ }
+
+ public static Texture loadTexture(String file) throws GLException, IOException
+ {
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ ImageIO.write(ImageIO.read(new File(file)), "png", os);
+ InputStream fis = new ByteArrayInputStream(os.toByteArray());
+ return TextureIO.newTexture(fis, true, TextureIO.PNG);
+ }
+
+}
\ No newline at end of file
diff --git a/src/org/warp/picalculator/gui/graphicengine/gpu/GPUDisplay.java b/src/org/warp/picalculator/gui/graphicengine/gpu/GPUDisplay.java
new file mode 100644
index 00000000..e08b85da
--- /dev/null
+++ b/src/org/warp/picalculator/gui/graphicengine/gpu/GPUDisplay.java
@@ -0,0 +1,102 @@
+package org.warp.picalculator.gui.graphicengine.gpu;
+
+import java.awt.image.BufferedImage;
+
+import org.warp.picalculator.Main;
+import org.warp.picalculator.Utils;
+import org.warp.picalculator.gui.graphicengine.Drawable;
+import org.warp.picalculator.gui.graphicengine.Renderer;
+
+public class GPUDisplay implements org.warp.picalculator.gui.graphicengine.Display {
+
+ private boolean initialized = false;
+ private CalculatorWindow wnd;
+ private Drawable d;
+ private GPURenderer r;
+
+ @Override
+ public int[] getSize() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isInitialized() {
+ return initialized;
+ }
+
+ @Override
+ public void setTitle(String title) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setResizable(boolean r) {
+ if (!r) {
+ wnd.window.setPosition(0, 0);
+ }
+ wnd.window.setResizable(r);
+ wnd.window.setUndecorated(!r);
+ wnd.window.setPointerVisible(r);
+ }
+
+ @Override
+ public void setDisplayMode(int ww, int wh) {
+ wnd.window.setSize(ww, wh);
+ }
+
+ @Override
+ public void create() {
+ r = new GPURenderer();
+ wnd = new CalculatorWindow(this);
+ wnd.create();
+ setDisplayMode(Main.screenSize[0], Main.screenSize[1]);
+ setResizable(Utils.debugOn&!Utils.debugThirdScreen);
+ initialized = true;
+ }
+
+ @Override
+ public boolean wasResized() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public int getWidth() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int getHeight() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public void destroy() {
+// EGL.destroy(); (Automatic)
+ }
+
+ @Override
+ public void start(Drawable d) {
+ this.d = d;
+ wnd.window.setVisible(true);
+ }
+
+ @Override
+ public void repaint() {
+ if (d != null) {
+ r.gl.glClearColor(red, green, blue, alpha);
+ d.refresh();
+ r.glFlush();
+ }
+ }
+
+ @Override
+ public GPURenderer getRenderer() {
+ return r;
+ }
+
+}
diff --git a/src/org/warp/picalculator/gui/graphicengine/gpu/GPURenderer.java b/src/org/warp/picalculator/gui/graphicengine/gpu/GPURenderer.java
new file mode 100644
index 00000000..9ae6b3eb
--- /dev/null
+++ b/src/org/warp/picalculator/gui/graphicengine/gpu/GPURenderer.java
@@ -0,0 +1,124 @@
+package org.warp.picalculator.gui.graphicengine.gpu;
+
+import java.awt.FontMetrics;
+import java.awt.image.BufferedImage;
+
+import org.warp.picalculator.gui.graphicengine.RAWFont;
+import org.warp.picalculator.gui.graphicengine.Renderer;
+
+import com.jogamp.opengl.GL2ES2;
+
+public class GPURenderer implements Renderer {
+
+ public GL2ES2 gl;
+
+ @Override
+ public void glColor3i(int r, int gg, int b) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void glColor(int c) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public int glGetClearColor() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public void glClearColor(int c) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void glColor4i(int red, int green, int blue, int alpha) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void glClearColor(int red, int green, int blue, int alpha) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void glClear() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void glDrawSkin(int skinwidth, int[] skin, int x0, int y0, int s0, int t0, int s1, int t1,
+ boolean transparent) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void glDrawLine(int x0, int y0, int x1, int y1) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void glFillRect(int x0, int y0, int w1, int h1) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public int[] getMatrixOfImage(BufferedImage bufferedImage) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void glDrawStringLeft(int x, int y, String text) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void glDrawStringCenter(int x, int y, String text) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void glDrawStringRight(int x, int y, String text) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void glSetFont(RAWFont font) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public int glGetStringWidth(RAWFont rf, String text) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int glGetFontWidth(FontMetrics fm, String text) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public RAWFont getCurrentFont() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/src/org/warp/picalculator/screens/ChooseVariableValueScreen.java b/src/org/warp/picalculator/gui/screens/ChooseVariableValueScreen.java
similarity index 55%
rename from src/org/warp/picalculator/screens/ChooseVariableValueScreen.java
rename to src/org/warp/picalculator/gui/screens/ChooseVariableValueScreen.java
index 7162086a..e0bcf95e 100644
--- a/src/org/warp/picalculator/screens/ChooseVariableValueScreen.java
+++ b/src/org/warp/picalculator/gui/screens/ChooseVariableValueScreen.java
@@ -1,12 +1,8 @@
-package org.warp.picalculator.screens;
-
-import static org.warp.picalculator.device.graphicengine.Display.Render.glColor3i;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glColor4i;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawStringCenter;
+package org.warp.picalculator.gui.screens;
import org.warp.picalculator.Main;
import org.warp.picalculator.device.Keyboard.Key;
-import org.warp.picalculator.device.graphicengine.Screen;
+import org.warp.picalculator.gui.PIDisplay;
import org.warp.picalculator.math.functions.Function;
import org.warp.picalculator.math.functions.Variable.VariableValue;
@@ -32,12 +28,12 @@ public class ChooseVariableValueScreen extends Screen {
@Override
public void render() {
- glColor4i(0, 0, 0, 64);
- glDrawStringCenter(Main.screenSize[0]/2+1, Main.screenSize[1]/4, "WORK IN PROGRESS. THIS SCREEN MUST HAVE A GUI TO SELECT THE VARIABLE TO SOLVE.");
- glDrawStringCenter(Main.screenSize[0]/2, Main.screenSize[1]/4+1, "WORK IN PROGRESS. THIS SCREEN MUST HAVE A GUI TO SELECT THE VARIABLE TO SOLVE.");
- glDrawStringCenter(Main.screenSize[0]/2+1, Main.screenSize[1]/4+1, "WORK IN PROGRESS. THIS SCREEN MUST HAVE A GUI TO SELECT THE VARIABLE TO SOLVE.");
- glColor3i(255, 0, 0);
- glDrawStringCenter(Main.screenSize[0]/2, Main.screenSize[1]/4, "WORK IN PROGRESS. THIS SCREEN MUST HAVE A GUI TO SELECT THE VARIABLE TO SOLVE.");
+ PIDisplay.renderer.glColor4i(0, 0, 0, 64);
+ PIDisplay.renderer.glDrawStringCenter(Main.screenSize[0]/2+1, Main.screenSize[1]/4, "WORK IN PROGRESS. THIS SCREEN MUST HAVE A GUI TO SELECT THE VARIABLE TO SOLVE.");
+ PIDisplay.renderer.glDrawStringCenter(Main.screenSize[0]/2, Main.screenSize[1]/4+1, "WORK IN PROGRESS. THIS SCREEN MUST HAVE A GUI TO SELECT THE VARIABLE TO SOLVE.");
+ PIDisplay.renderer.glDrawStringCenter(Main.screenSize[0]/2+1, Main.screenSize[1]/4+1, "WORK IN PROGRESS. THIS SCREEN MUST HAVE A GUI TO SELECT THE VARIABLE TO SOLVE.");
+ PIDisplay.renderer.glColor3i(255, 0, 0);
+ PIDisplay.renderer.glDrawStringCenter(Main.screenSize[0]/2, Main.screenSize[1]/4, "WORK IN PROGRESS. THIS SCREEN MUST HAVE A GUI TO SELECT THE VARIABLE TO SOLVE.");
}
@Override
diff --git a/src/org/warp/picalculator/screens/EmptyScreen.java b/src/org/warp/picalculator/gui/screens/EmptyScreen.java
similarity index 82%
rename from src/org/warp/picalculator/screens/EmptyScreen.java
rename to src/org/warp/picalculator/gui/screens/EmptyScreen.java
index 7b47224a..0fea5479 100644
--- a/src/org/warp/picalculator/screens/EmptyScreen.java
+++ b/src/org/warp/picalculator/gui/screens/EmptyScreen.java
@@ -1,7 +1,6 @@
-package org.warp.picalculator.screens;
+package org.warp.picalculator.gui.screens;
import org.warp.picalculator.device.Keyboard.Key;
-import org.warp.picalculator.device.graphicengine.Screen;
public class EmptyScreen extends Screen {
diff --git a/src/org/warp/picalculator/screens/KeyboardDebugScreen.java b/src/org/warp/picalculator/gui/screens/KeyboardDebugScreen.java
similarity index 59%
rename from src/org/warp/picalculator/screens/KeyboardDebugScreen.java
rename to src/org/warp/picalculator/gui/screens/KeyboardDebugScreen.java
index 0ef15378..49ab8309 100644
--- a/src/org/warp/picalculator/screens/KeyboardDebugScreen.java
+++ b/src/org/warp/picalculator/gui/screens/KeyboardDebugScreen.java
@@ -1,12 +1,12 @@
-package org.warp.picalculator.screens;
+package org.warp.picalculator.gui.screens;
-import static org.warp.picalculator.device.PIDisplay.colore;
-import static org.warp.picalculator.device.PIDisplay.fonts;
-import static org.warp.picalculator.device.graphicengine.Display.Render.*;
+import static org.warp.picalculator.device.graphicengine.cpu.CPUDisplay.Render.*;
+import static org.warp.picalculator.gui.PIDisplay.colore;
+import static org.warp.picalculator.gui.PIDisplay.fonts;
import org.warp.picalculator.Main;
import org.warp.picalculator.device.Keyboard.Key;
-import org.warp.picalculator.device.graphicengine.Screen;
+import org.warp.picalculator.gui.PIDisplay;
public class KeyboardDebugScreen extends Screen {
@@ -32,33 +32,33 @@ public class KeyboardDebugScreen extends Screen {
@Override
public void render() {
- glSetFont(fonts[2]);
+ PIDisplay.renderer.glSetFont(fonts[2]);
colore(0.75f, 0.0f, 0.0f, 1.0f);
- glDrawStringRight(Main.screenSize[0] - 10, 30, "-" + keyevent.toUpperCase() + "-");
+ PIDisplay.renderer.glDrawStringRight(Main.screenSize[0] - 10, 30, "-" + keyevent.toUpperCase() + "-");
if (keyevent != "NONE") {
- glSetFont(fonts[2]);
+ PIDisplay.renderer.glSetFont(fonts[2]);
colore(0.0f, 0.0f, 0.0f, 1.0f);
- glDrawStringLeft(10, 30, "Key position");
- glDrawStringLeft(10, 45, "X: " + keyX + ", Y:" + keyY);
- glDrawStringLeft(10, 65, "Key value");
- glDrawStringLeft(10, 80, key);
+ PIDisplay.renderer.glDrawStringLeft(10, 30, "Key position");
+ PIDisplay.renderer.glDrawStringLeft(10, 45, "X: " + keyX + ", Y:" + keyY);
+ PIDisplay.renderer.glDrawStringLeft(10, 65, "Key value");
+ PIDisplay.renderer.glDrawStringLeft(10, 80, key);
}
- glSetFont(fonts[3]);
+ PIDisplay.renderer.glSetFont(fonts[3]);
colore(0.0f, 0.0f, 0.0f, 1.0f);
for (int i = 0; i < 5; i++) {
if (log[i] != null) {
- glDrawStringLeft(10, 230 + 15*(i+1), log[i].toUpperCase());
+ PIDisplay.renderer.glDrawStringLeft(10, 230 + 15*(i+1), log[i].toUpperCase());
}
}
//FROM SERIAL
colore(0.0f, 0.0f, 0.0f, 1.0f);
- glFillRect(-80+100+200, 90, 5, 5);
- glFillRect(-80+100, 100, 200, 70);
- glSetFont(fonts[2]);
+ PIDisplay.renderer.glFillRect(-80+100+200, 90, 5, 5);
+ PIDisplay.renderer.glFillRect(-80+100, 100, 200, 70);
+ PIDisplay.renderer.glSetFont(fonts[2]);
colore(1.0f, 1.0f, 1.0f, 1.0f);
- glDrawStringCenter(-80+100+200/2, 100+70/2-(currentFont.charH/2), "FROM SERIAL");
- glSetFont(fonts[3]);
+ PIDisplay.renderer.glDrawStringCenter(-80+100+200/2, 100+70/2-(PIDisplay.renderer.getCurrentFont().charH/2), "FROM SERIAL");
+ PIDisplay.renderer.glSetFont(fonts[3]);
colore(0.0f, 0.0f, 1.0f, 1.0f);
for (int i = 0; i < 8; i++) {
if (pinsA[i] == 1) {
@@ -70,9 +70,9 @@ public class KeyboardDebugScreen extends Screen {
} else if (pinsA[i] == 0) {
colore(1.0f, 0.0f, 0.0f, 1.0f);
}
- glFillRect(-80+103+25*(7-i), 80, 20, 20);
+ PIDisplay.renderer.glFillRect(-80+103+25*(7-i), 80, 20, 20);
colore(0.0f, 0.0f, 0.0f, 1.0f);
- glDrawStringCenter(-80+113+25*(7-i), 90-(currentFont.charH/2), ""+(i+1));
+ PIDisplay.renderer.glDrawStringCenter(-80+113+25*(7-i), 90-(PIDisplay.renderer.getCurrentFont().charH/2), ""+(i+1));
}
for (int i = 15; i >= 8; i--) {
if (pinsA[i] == 1) {
@@ -84,9 +84,9 @@ public class KeyboardDebugScreen extends Screen {
} else if (pinsA[i] == 0) {
colore(1.0f, 0.0f, 0.0f, 1.0f);
}
- glFillRect(-80+103+25*(i-8), 170, 20, 20);
+ PIDisplay.renderer.glFillRect(-80+103+25*(i-8), 170, 20, 20);
colore(0.0f, 0.0f, 0.0f, 1.0f);
- glDrawStringCenter(-80+113+25*(i-8), 180-(currentFont.charH/2), ""+(i+1));
+ PIDisplay.renderer.glDrawStringCenter(-80+113+25*(i-8), 180-(PIDisplay.renderer.getCurrentFont().charH/2), ""+(i+1));
}
for (int i = 0; i < 8; i++) {
if (dataA[i]) {
@@ -94,17 +94,17 @@ public class KeyboardDebugScreen extends Screen {
} else {
colore(1.0f, 0.0f, 0.0f, 1.0f);
}
- glFillRect(-80+160+10*(i), 150, 8, 8);
+ PIDisplay.renderer.glFillRect(-80+160+10*(i), 150, 8, 8);
}
//TO SERIAL
colore(0.0f, 0.0f, 0.0f, 1.0f);
- glFillRect(150+90, 200, 5, 5);
- glFillRect(150+100, 100, 200, 70);
- glSetFont(fonts[2]);
+ PIDisplay.renderer.glFillRect(150+90, 200, 5, 5);
+ PIDisplay.renderer.glFillRect(150+100, 100, 200, 70);
+ PIDisplay.renderer.glSetFont(fonts[2]);
colore(1.0f, 1.0f, 1.0f, 1.0f);
- glDrawStringCenter(150+100+200/2, 100+70/2-(currentFont.charH/2), "TO SERIAL");
- glSetFont(fonts[3]);
+ PIDisplay.renderer.glDrawStringCenter(150+100+200/2, 100+70/2-(PIDisplay.renderer.getCurrentFont().charH/2), "TO SERIAL");
+ PIDisplay.renderer.glSetFont(fonts[3]);
colore(0.0f, 0.0f, 1.0f, 1.0f);
for (int i = 15; i >= 8; i--) {
if (pinsB[i] == 1) {
@@ -116,9 +116,9 @@ public class KeyboardDebugScreen extends Screen {
} else if (pinsB[i] == 0) {
colore(1.0f, 0.0f, 0.0f, 1.0f);
}
- glFillRect(150+103+25*(15-i), 80, 20, 20);
+ PIDisplay.renderer.glFillRect(150+103+25*(15-i), 80, 20, 20);
colore(0.0f, 0.0f, 0.0f, 1.0f);
- glDrawStringCenter(150+113+25*(15-i), 90-(currentFont.charH/2), ""+(i+1));
+ PIDisplay.renderer.glDrawStringCenter(150+113+25*(15-i), 90-(PIDisplay.renderer.getCurrentFont().charH/2), ""+(i+1));
}
for (int i = 7; i >= 0; i--) {
if (pinsB[i] == 1) {
@@ -130,9 +130,9 @@ public class KeyboardDebugScreen extends Screen {
} else if (pinsB[i] == 0) {
colore(1.0f, 0.0f, 0.0f, 1.0f);
}
- glFillRect(150+103+25*(i), 170, 20, 20);
+ PIDisplay.renderer.glFillRect(150+103+25*(i), 170, 20, 20);
colore(0.0f, 0.0f, 0.0f, 1.0f);
- glDrawStringCenter(150+113+25*(i), 180-(currentFont.charH/2), ""+(i+1));
+ PIDisplay.renderer.glDrawStringCenter(150+113+25*(i), 180-(PIDisplay.renderer.getCurrentFont().charH/2), ""+(i+1));
}
for (int i = 0; i < 8; i++) {
if (dataB[i]) {
@@ -140,7 +140,7 @@ public class KeyboardDebugScreen extends Screen {
} else {
colore(1.0f, 0.0f, 0.0f, 1.0f);
}
- glFillRect(150+160+10*(i), 150, 8, 8);
+ PIDisplay.renderer.glFillRect(150+160+10*(i), 150, 8, 8);
}
//GPIO
@@ -151,13 +151,13 @@ public class KeyboardDebugScreen extends Screen {
colore(1.0f, 0.0f, 0.0f, 1.0f);
}
if (i % 2 == 0) {
- glFillRect(53+15*((i)/2), 50, 5, 5);
+ PIDisplay.renderer.glFillRect(53+15*((i)/2), 50, 5, 5);
colore(0.0f, 0.0f, 0.0f, 1.0f);
- glDrawStringCenter(55+15*((i)/2), 60, ""+(i+1));
+ PIDisplay.renderer.glDrawStringCenter(55+15*((i)/2), 60, ""+(i+1));
} else {
- glFillRect(53+15*((i-1)/2), 40, 5, 5);
+ PIDisplay.renderer.glFillRect(53+15*((i-1)/2), 40, 5, 5);
colore(0.0f, 0.0f, 0.0f, 1.0f);
- glDrawStringCenter(55+15*((i-1)/2), 35-currentFont.charH, ""+(i+1));
+ PIDisplay.renderer.glDrawStringCenter(55+15*((i-1)/2), 35-PIDisplay.renderer.getCurrentFont().charH, ""+(i+1));
}
}
@@ -169,7 +169,7 @@ public class KeyboardDebugScreen extends Screen {
} else {
colore(1.0f, 0.0f, 0.0f, 1.0f);
}
- glFillRect(250+6*c, 250+6*r, 5, 5);
+ PIDisplay.renderer.glFillRect(250+6*c, 250+6*r, 5, 5);
}
}
}
diff --git a/src/org/warp/picalculator/screens/LoadingScreen.java b/src/org/warp/picalculator/gui/screens/LoadingScreen.java
similarity index 55%
rename from src/org/warp/picalculator/screens/LoadingScreen.java
rename to src/org/warp/picalculator/gui/screens/LoadingScreen.java
index bb1963a8..c5014763 100644
--- a/src/org/warp/picalculator/screens/LoadingScreen.java
+++ b/src/org/warp/picalculator/gui/screens/LoadingScreen.java
@@ -1,14 +1,11 @@
-package org.warp.picalculator.screens;
+package org.warp.picalculator.gui.screens;
-import static org.warp.picalculator.device.PIDisplay.colore;
-import static org.warp.picalculator.device.PIDisplay.fonts;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawStringCenter;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glSetFont;
+import static org.warp.picalculator.gui.PIDisplay.colore;
+import static org.warp.picalculator.gui.PIDisplay.fonts;
import org.warp.picalculator.Main;
import org.warp.picalculator.device.Keyboard.Key;
-import org.warp.picalculator.device.PIDisplay;
-import org.warp.picalculator.device.graphicengine.Screen;
+import org.warp.picalculator.gui.PIDisplay;
public class LoadingScreen extends Screen {
@@ -59,23 +56,23 @@ public class LoadingScreen extends Screen {
@Override
public void render() {
- glSetFont(fonts[2]);
+ PIDisplay.renderer.glSetFont(fonts[2]);
colore(1.0f, 1.0f, 1.0f, 1.0f);
- glDrawStringCenter((Main.screenSize[0] / 2) - 1,(int) ((Main.screenSize[1]/ 2) - 25 + loadingTextTranslation), titleString);
+ PIDisplay.renderer.glDrawStringCenter((Main.screenSize[0] / 2) - 1,(int) ((Main.screenSize[1]/ 2) - 25 + loadingTextTranslation), titleString);
colore(1.0f, 1.0f, 1.0f, 1.0f);
- glDrawStringCenter((Main.screenSize[0] / 2) + 1,(int) ((Main.screenSize[1]/ 2) - 25 + loadingTextTranslation), titleString);
+ PIDisplay.renderer.glDrawStringCenter((Main.screenSize[0] / 2) + 1,(int) ((Main.screenSize[1]/ 2) - 25 + loadingTextTranslation), titleString);
colore(1.0f, 1.0f, 1.0f, 1.0f);
- glDrawStringCenter((Main.screenSize[0] / 2), (int) ((Main.screenSize[1]/ 2) - 25 - 1 + loadingTextTranslation), titleString);
+ PIDisplay.renderer.glDrawStringCenter((Main.screenSize[0] / 2), (int) ((Main.screenSize[1]/ 2) - 25 - 1 + loadingTextTranslation), titleString);
colore(1.0f, 1.0f, 1.0f, 1.0f);
- glDrawStringCenter((Main.screenSize[0] / 2), (int) ((Main.screenSize[1]/ 2) - 25 + 1 + loadingTextTranslation), titleString);
+ PIDisplay.renderer.glDrawStringCenter((Main.screenSize[0] / 2), (int) ((Main.screenSize[1]/ 2) - 25 + 1 + loadingTextTranslation), titleString);
colore(1.0f, 0.5f, 0.0f, 1.0f);
- glDrawStringCenter((Main.screenSize[0] / 2), (int) ((Main.screenSize[1]/ 2) - 25 + loadingTextTranslation), titleString);
+ PIDisplay.renderer.glDrawStringCenter((Main.screenSize[0] / 2), (int) ((Main.screenSize[1]/ 2) - 25 + loadingTextTranslation), titleString);
colore(0.0f, 0.0f, 0.0f, 0.75f);
- glSetFont(fonts[0]);
- glDrawStringCenter((Main.screenSize[0] / 2), (Main.screenSize[1]/ 2) + 11, "LOADING");
- glSetFont(fonts[1]);
+ PIDisplay.renderer.glSetFont(fonts[0]);
+ PIDisplay.renderer.glDrawStringCenter((Main.screenSize[0] / 2), (Main.screenSize[1]/ 2) + 11, "LOADING");
+ PIDisplay.renderer.glSetFont(fonts[1]);
colore(0.0f, 0.0f, 0.0f, 0.5f);
- glDrawStringCenter((Main.screenSize[0] / 2), (Main.screenSize[1]/ 2) + 22, "PLEASE WAIT...");
+ PIDisplay.renderer.glDrawStringCenter((Main.screenSize[0] / 2), (Main.screenSize[1]/ 2) + 22, "PLEASE WAIT...");
}
diff --git a/src/org/warp/picalculator/screens/MarioScreen.java b/src/org/warp/picalculator/gui/screens/MarioScreen.java
similarity index 64%
rename from src/org/warp/picalculator/screens/MarioScreen.java
rename to src/org/warp/picalculator/gui/screens/MarioScreen.java
index b6f6e914..b8957680 100644
--- a/src/org/warp/picalculator/screens/MarioScreen.java
+++ b/src/org/warp/picalculator/gui/screens/MarioScreen.java
@@ -1,10 +1,4 @@
-package org.warp.picalculator.screens;
-
-import static org.warp.picalculator.device.graphicengine.Display.Render.getMatrixOfImage;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glClearColor;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawSkin;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawStringLeft;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glSetFont;
+package org.warp.picalculator.gui.screens;
import java.awt.image.BufferedImage;
import java.io.IOException;
@@ -14,8 +8,7 @@ import javax.imageio.ImageIO;
import org.warp.picalculator.Main;
import org.warp.picalculator.device.Keyboard;
import org.warp.picalculator.device.Keyboard.Key;
-import org.warp.picalculator.device.PIDisplay;
-import org.warp.picalculator.device.graphicengine.Screen;
+import org.warp.picalculator.gui.PIDisplay;
public class MarioScreen extends Screen {
@@ -45,7 +38,7 @@ public class MarioScreen extends Screen {
BufferedImage img;
try {
img = ImageIO.read(Main.instance.getClass().getResource("/marioskin.png"));
- skin = getMatrixOfImage(img);
+ skin = PIDisplay.renderer.getMatrixOfImage(img);
skinSize = new int[] { img.getWidth(), img.getHeight() };
} catch (IOException e) {
e.printStackTrace();
@@ -53,7 +46,7 @@ public class MarioScreen extends Screen {
}
try {
img = ImageIO.read(Main.instance.getClass().getResource("/marioground.png"));
- ground = getMatrixOfImage(img);
+ ground = PIDisplay.renderer.getMatrixOfImage(img);
groundSize = new int[] { img.getWidth(), img.getHeight() };
} catch (IOException e) {
e.printStackTrace();
@@ -135,34 +128,34 @@ public class MarioScreen extends Screen {
}
marioForces[0] *= 0.75;
- glClearColor(0xff9290ff);
+ PIDisplay.renderer.glClearColor(0xff9290ff);
}
}
@Override
public void render() {
if (errored) {
- glDrawStringLeft(0, 20, "ERROR");
+ PIDisplay.renderer.glDrawStringLeft(0, 20, "ERROR");
} else {
- glSetFont(PIDisplay.fonts[0]);
- glDrawSkin(groundSize[0], ground, 0, 25+25, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 16, 25+25, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 16*2, 25+25, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 16*3, 25+25, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 16*4, 25+25, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 16*5, 25+25, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 16*6, 25+25, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 16*7, 25+25, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 16*8, 25+25, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 0, 25+25+16, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 16, 25+25+16, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 16*2, 25+25+16, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 16*3, 25+25+16, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 16*4, 25+25+16, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 16*5, 25+25+16, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 16*6, 25+25+16, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 16*7, 25+25+16, 0, 0, 16, 16, false);
- glDrawSkin(groundSize[0], ground, 16*8, 25+25+16, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glSetFont(PIDisplay.fonts[0]);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 0, 25+25, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 16, 25+25, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 16*2, 25+25, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 16*3, 25+25, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 16*4, 25+25, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 16*5, 25+25, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 16*6, 25+25, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 16*7, 25+25, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 16*8, 25+25, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 0, 25+25+16, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 16, 25+25+16, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 16*2, 25+25+16, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 16*3, 25+25+16, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 16*4, 25+25+16, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 16*5, 25+25+16, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 16*6, 25+25+16, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 16*7, 25+25+16, 0, 0, 16, 16, false);
+ PIDisplay.renderer.glDrawSkin(groundSize[0], ground, 16*8, 25+25+16, 0, 0, 16, 16, false);
// EASTER EGG
// glSetFont(PIDisplay.fonts[4]);
@@ -182,7 +175,7 @@ public class MarioScreen extends Screen {
// glDrawStringRight(0, Main.screenSize[1]-glGetCurrentFontHeight(), "G");
//DRAW MARIO
- glDrawSkin(skinSize[0], skin, getPosX()-18, 25+getPosY(), 35*(marioSkinPos[0]+(flipped?2:1)), 27*marioSkinPos[1], 35*(marioSkinPos[0]+(flipped?1:2)), 27*(marioSkinPos[1]+1), true);
+ PIDisplay.renderer.glDrawSkin(skinSize[0], skin, getPosX()-18, 25+getPosY(), 35*(marioSkinPos[0]+(flipped?2:1)), 27*marioSkinPos[1], 35*(marioSkinPos[0]+(flipped?1:2)), 27*(marioSkinPos[1]+1), true);
}
}
diff --git a/src/org/warp/picalculator/screens/MathInputScreen.java b/src/org/warp/picalculator/gui/screens/MathInputScreen.java
similarity index 87%
rename from src/org/warp/picalculator/screens/MathInputScreen.java
rename to src/org/warp/picalculator/gui/screens/MathInputScreen.java
index c8bab1f5..538b5b0f 100644
--- a/src/org/warp/picalculator/screens/MathInputScreen.java
+++ b/src/org/warp/picalculator/gui/screens/MathInputScreen.java
@@ -1,13 +1,4 @@
-package org.warp.picalculator.screens;
-
-import static org.warp.picalculator.device.graphicengine.Display.Render.clearcolor;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glClearColor;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glColor;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawStringLeft;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawStringRight;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glFillRect;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glGetStringWidth;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glSetFont;
+package org.warp.picalculator.gui.screens;
import java.io.PrintWriter;
import java.io.StringWriter;
@@ -24,10 +15,8 @@ import org.warp.picalculator.Main;
import org.warp.picalculator.Utils;
import org.warp.picalculator.device.Keyboard;
import org.warp.picalculator.device.Keyboard.Key;
-import org.warp.picalculator.device.PIDisplay;
-import org.warp.picalculator.device.graphicengine.Display;
-import org.warp.picalculator.device.graphicengine.RAWFont;
-import org.warp.picalculator.device.graphicengine.Screen;
+import org.warp.picalculator.gui.PIDisplay;
+import org.warp.picalculator.gui.graphicengine.RAWFont;
import org.warp.picalculator.math.AngleMode;
import org.warp.picalculator.math.Calculator;
import org.warp.picalculator.math.MathematicalSymbols;
@@ -146,23 +135,38 @@ public class MathInputScreen extends Screen {
}
if (PIDisplay.error == null) {
- glClearColor(0xFFc5c2af);
+ PIDisplay.renderer.glClearColor(0xFFc5c2af);
} else {
- glClearColor(0xFFDC3C32);
+ PIDisplay.renderer.glClearColor(0xFFDC3C32);
}
}
private static final RAWFont fontBig = Utils.getFont(false);
+ @Override
+ public void renderStatusbar() {
+ PIDisplay.renderer.glColor3i(0, 0, 0);
+ int pos = 2;
+ int spacersNumb = 1;
+ int skinN = 0;
+ if (calc.exactMode) {
+ skinN = 22;
+ PIDisplay.drawSkinPart(2 + 18 * pos + 2 * spacersNumb, 2, 16 * skinN, 16 * 0, 16 + 16 * skinN, 16 + 16 * 0);
+ } else {
+ skinN = 21;
+ PIDisplay.drawSkinPart(2 + 18 * pos + 2 * spacersNumb, 2, 16 * skinN, 16 * 0, 16 + 16 * skinN, 16 + 16 * 0);
+ }
+ }
+
@Override
public void render() {
- Display.Render.glSetFont(fontBig);
+ PIDisplay.renderer.glSetFont(fontBig);
final int textColor = 0xFF000000;
final int padding = 4;
- glColor(textColor);
+ PIDisplay.renderer.glColor(textColor);
final int caretRealPos = MathematicalSymbols.getGraphicRepresentation(nuovaEquazione.substring(0, caretPos)).length()*(fontBig.charW+1);
final String inputTextWithoutCaret = MathematicalSymbols.getGraphicRepresentation(nuovaEquazione);
- final boolean tooLongI = padding+glGetStringWidth(fontBig, nuovaEquazione)+padding >= Main.screenSize[0];
+ final boolean tooLongI = padding+PIDisplay.renderer.glGetStringWidth(fontBig, nuovaEquazione)+padding >= Main.screenSize[0];
int scrollI = 0;
if (tooLongI) {
scrollI = -scrollX;
@@ -172,14 +176,14 @@ public class MathInputScreen extends Screen {
scrollI = 0;
}
}
- glDrawStringLeft(padding+scrollI, padding+20, inputTextWithoutCaret);
+ PIDisplay.renderer.glDrawStringLeft(padding+scrollI, padding+20, inputTextWithoutCaret);
if (showCaret) {
- glDrawStringLeft(padding+scrollI+caretRealPos, padding+20, "|");
+ PIDisplay.renderer.glDrawStringLeft(padding+scrollI+caretRealPos, padding+20, "|");
}
if (tooLongI) {
- glColor(clearcolor);
- glFillRect(Main.screenSize[0]-16-2, padding+20, fontBig.charH, Main.screenSize[0]);
- glColor(textColor);
+ PIDisplay.renderer.glColor(PIDisplay.renderer.glGetClearColor());
+ PIDisplay.renderer.glFillRect(Main.screenSize[0]-16-2, padding+20, fontBig.charH, Main.screenSize[0]);
+ PIDisplay.renderer.glColor(textColor);
PIDisplay.drawSkinPart(Main.screenSize[0]-16, padding+20+fontBig.charH/2-16/2, 304, 0, 304+16, 16);
}
if (calc.f != null) {
@@ -201,9 +205,9 @@ public class MathInputScreen extends Screen {
final int y = padding+20+padding+fontBig.charH+1+topSpacing;
fnc.draw(padding+scrollA, y);
if (tooLong) {
- glColor(clearcolor);
- glFillRect(Main.screenSize[0]-16-2, y, fnc.getHeight(), Main.screenSize[0]);
- glColor(textColor);
+ PIDisplay.renderer.glColor(PIDisplay.renderer.glGetClearColor());
+ PIDisplay.renderer.glFillRect(Main.screenSize[0]-16-2, y, fnc.getHeight(), Main.screenSize[0]);
+ PIDisplay.renderer.glColor(textColor);
PIDisplay.drawSkinPart(Main.screenSize[0]-16, y+fnc.getHeight()/2-16/2, 304, 0, 304+16, 16);
}
} catch (NullPointerException e) {
@@ -216,14 +220,14 @@ public class MathInputScreen extends Screen {
int bottomSpacing = 0;
for (Function f : calc.f2) {
bottomSpacing += f.getHeight()+2;
- f.draw(Display.getWidth() - 2 - f.getWidth(), Display.getHeight() - bottomSpacing);
+ f.draw(PIDisplay.display.getWidth() - 2 - f.getWidth(), PIDisplay.display.getHeight() - bottomSpacing);
}
if (calc.resultsCount > 1 && calc.resultsCount != calc.f2.size()) {
String resultsCountText = calc.resultsCount+" total results".toUpperCase();
- glColor(0xFF9AAEA0);
- glSetFont(Utils.getFont(true));
+ PIDisplay.renderer.glColor(0xFF9AAEA0);
+ PIDisplay.renderer.glSetFont(Utils.getFont(true));
bottomSpacing += fontBig.charH+2;
- glDrawStringRight(Display.getWidth() - 2, Display.getHeight() - bottomSpacing, resultsCountText);
+ PIDisplay.renderer.glDrawStringRight(PIDisplay.display.getWidth() - 2, PIDisplay.display.getHeight() - bottomSpacing, resultsCountText);
}
}
}
@@ -430,7 +434,7 @@ public class MathInputScreen extends Screen {
} else {
caretPos = nuovaEquazione.length();
}
- scrollX = glGetStringWidth(fontBig, nuovaEquazione.substring(0, caretPos)+"|||");
+ scrollX = PIDisplay.renderer.glGetStringWidth(fontBig, nuovaEquazione.substring(0, caretPos)+"|||");
showCaret = true;
showCaretDelta = 0L;
return true;
@@ -440,7 +444,7 @@ public class MathInputScreen extends Screen {
} else {
caretPos = 0;
}
- scrollX = glGetStringWidth(fontBig, nuovaEquazione.substring(0, caretPos)+"|||");
+ scrollX = PIDisplay.renderer.glGetStringWidth(fontBig, nuovaEquazione.substring(0, caretPos)+"|||");
showCaret = true;
showCaretDelta = 0L;
return true;
@@ -647,7 +651,7 @@ public class MathInputScreen extends Screen {
MathInputScreen cloned = clone();
cloned.caretPos = cloned.equazioneCorrente.length();
cloned.nuovaEquazione = cloned.equazioneCorrente;
- cloned.scrollX = glGetStringWidth(fontBig, cloned.equazioneCorrente);
+ cloned.scrollX = PIDisplay.renderer.glGetStringWidth(fontBig, cloned.equazioneCorrente);
try {cloned.interpreta(true);} catch (Error e) {}
PIDisplay.INSTANCE.replaceScreen(cloned);
this.initialized = false;
@@ -660,7 +664,7 @@ public class MathInputScreen extends Screen {
int len = chr.length();
nuovaEquazione=nuovaEquazione.substring(0, caretPos)+chr+nuovaEquazione.substring(caretPos, nuovaEquazione.length());
caretPos+=len;
- scrollX = glGetStringWidth(fontBig, nuovaEquazione.substring(0, caretPos)+"|||");
+ scrollX = PIDisplay.renderer.glGetStringWidth(fontBig, nuovaEquazione.substring(0, caretPos)+"|||");
showCaret = true;
showCaretDelta = 0L;
afterDoNextStep = false;
diff --git a/src/org/warp/picalculator/device/graphicengine/Screen.java b/src/org/warp/picalculator/gui/screens/Screen.java
similarity index 82%
rename from src/org/warp/picalculator/device/graphicengine/Screen.java
rename to src/org/warp/picalculator/gui/screens/Screen.java
index 4395c6e0..21ea5a13 100644
--- a/src/org/warp/picalculator/device/graphicengine/Screen.java
+++ b/src/org/warp/picalculator/gui/screens/Screen.java
@@ -1,7 +1,7 @@
-package org.warp.picalculator.device.graphicengine;
+package org.warp.picalculator.gui.screens;
import org.warp.picalculator.device.Keyboard.Key;
-import org.warp.picalculator.device.PIDisplay;
+import org.warp.picalculator.gui.PIDisplay;
public abstract class Screen {
public PIDisplay d;
@@ -30,6 +30,10 @@ public abstract class Screen {
public abstract void init() throws InterruptedException;
public abstract void render();
+
+ public void renderStatusbar() {
+
+ }
public abstract void beforeRender(float dt);
diff --git a/src/org/warp/picalculator/screens/SolveEquationScreen.java b/src/org/warp/picalculator/gui/screens/SolveEquationScreen.java
similarity index 53%
rename from src/org/warp/picalculator/screens/SolveEquationScreen.java
rename to src/org/warp/picalculator/gui/screens/SolveEquationScreen.java
index df8ca635..e7c35118 100644
--- a/src/org/warp/picalculator/screens/SolveEquationScreen.java
+++ b/src/org/warp/picalculator/gui/screens/SolveEquationScreen.java
@@ -1,14 +1,9 @@
-package org.warp.picalculator.screens;
-
-import static org.warp.picalculator.device.graphicengine.Display.Render.glColor3i;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glColor4i;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawStringCenter;
+package org.warp.picalculator.gui.screens;
import org.warp.picalculator.Error;
import org.warp.picalculator.Main;
import org.warp.picalculator.device.Keyboard.Key;
-import org.warp.picalculator.device.PIDisplay;
-import org.warp.picalculator.device.graphicengine.Screen;
+import org.warp.picalculator.gui.PIDisplay;
import org.warp.picalculator.math.Calculator;
public class SolveEquationScreen extends Screen {
@@ -32,12 +27,12 @@ public class SolveEquationScreen extends Screen {
@Override
public void render() {
- glColor4i(0, 0, 0, 64);
- glDrawStringCenter(Main.screenSize[0]/2+1, Main.screenSize[1]/4, "WORK IN PROGRESS. THIS SCREEN MUST HAVE A GUI TO SELECT THE VARIABLE TO SOLVE.");
- glDrawStringCenter(Main.screenSize[0]/2, Main.screenSize[1]/4+1, "WORK IN PROGRESS. THIS SCREEN MUST HAVE A GUI TO SELECT THE VARIABLE TO SOLVE.");
- glDrawStringCenter(Main.screenSize[0]/2+1, Main.screenSize[1]/4+1, "WORK IN PROGRESS. THIS SCREEN MUST HAVE A GUI TO SELECT THE VARIABLE TO SOLVE.");
- glColor3i(255, 0, 0);
- glDrawStringCenter(Main.screenSize[0]/2, Main.screenSize[1]/4, "WORK IN PROGRESS. THIS SCREEN MUST HAVE A GUI TO SELECT THE VARIABLE TO SOLVE.");
+ PIDisplay.renderer.glColor4i(0, 0, 0, 64);
+ PIDisplay.renderer.glDrawStringCenter(Main.screenSize[0]/2+1, Main.screenSize[1]/4, "WORK IN PROGRESS. THIS SCREEN MUST HAVE A GUI TO SELECT THE VARIABLE TO SOLVE.");
+ PIDisplay.renderer.glDrawStringCenter(Main.screenSize[0]/2, Main.screenSize[1]/4+1, "WORK IN PROGRESS. THIS SCREEN MUST HAVE A GUI TO SELECT THE VARIABLE TO SOLVE.");
+ PIDisplay.renderer.glDrawStringCenter(Main.screenSize[0]/2+1, Main.screenSize[1]/4+1, "WORK IN PROGRESS. THIS SCREEN MUST HAVE A GUI TO SELECT THE VARIABLE TO SOLVE.");
+ PIDisplay.renderer.glColor3i(255, 0, 0);
+ PIDisplay.renderer.glDrawStringCenter(Main.screenSize[0]/2, Main.screenSize[1]/4, "WORK IN PROGRESS. THIS SCREEN MUST HAVE A GUI TO SELECT THE VARIABLE TO SOLVE.");
}
@Override
diff --git a/src/org/warp/picalculator/math/functions/AnteriorFunction.java b/src/org/warp/picalculator/math/functions/AnteriorFunction.java
index 3eeb0d6e..0e61fdbe 100644
--- a/src/org/warp/picalculator/math/functions/AnteriorFunction.java
+++ b/src/org/warp/picalculator/math/functions/AnteriorFunction.java
@@ -1,13 +1,11 @@
package org.warp.picalculator.math.functions;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawStringLeft;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glGetStringWidth;
-
import java.util.ArrayList;
import org.warp.picalculator.Error;
import org.warp.picalculator.Utils;
-import org.warp.picalculator.device.graphicengine.Display;
+import org.warp.picalculator.gui.PIDisplay;
+import org.warp.picalculator.gui.graphicengine.cpu.CPUDisplay;
import org.warp.picalculator.math.Calculator;
import com.rits.cloning.Cloner;
@@ -85,7 +83,7 @@ public abstract class AnteriorFunction implements Function {
variable.setSmall(small);
variable.generateGraphics();
- width = glGetStringWidth(Utils.getFont(small), getSymbol()) + 1 + getVariable().getWidth();
+ width = PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), getSymbol()) + 1 + getVariable().getWidth();
height = variable.getHeight();
line = variable.getLine();
}
@@ -93,12 +91,12 @@ public abstract class AnteriorFunction implements Function {
@Override
public void draw(int x, int y) {
float h1 = getVariable().getHeight();
- int wsegno = glGetStringWidth(Utils.getFont(small), getSymbol());
+ int wsegno = PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), getSymbol());
float hsegno = Utils.getFontHeight(small);
float maxh = getHeight();
- Display.Render.glSetFont(Utils.getFont(small));
+ PIDisplay.renderer.glSetFont(Utils.getFont(small));
- glDrawStringLeft(x, (int) Math.floor(y + (maxh - hsegno) / 2), getSymbol());
+ PIDisplay.renderer.glDrawStringLeft(x, (int) Math.floor(y + (maxh - hsegno) / 2), getSymbol());
getVariable().draw(x + wsegno + 1, (int) Math.floor(y + (maxh - h1) / 2));
}
diff --git a/src/org/warp/picalculator/math/functions/Division.java b/src/org/warp/picalculator/math/functions/Division.java
index 1c28b767..0b69cb67 100644
--- a/src/org/warp/picalculator/math/functions/Division.java
+++ b/src/org/warp/picalculator/math/functions/Division.java
@@ -1,14 +1,11 @@
package org.warp.picalculator.math.functions;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawStringLeft;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glFillRect;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glGetStringWidth;
-
import java.util.ArrayList;
import org.warp.picalculator.Error;
import org.warp.picalculator.Utils;
-import org.warp.picalculator.device.graphicengine.Display;
+import org.warp.picalculator.gui.PIDisplay;
+import org.warp.picalculator.gui.graphicengine.cpu.CPUDisplay;
import org.warp.picalculator.math.Calculator;
import org.warp.picalculator.math.MathematicalSymbols;
import org.warp.picalculator.math.rules.FractionsRule1;
@@ -108,9 +105,9 @@ public class Division extends FunctionTwoValues {
}
int w1 = 0;
int h1 = 0;
- Display.Render.glSetFont(Utils.getFont(small));
+ PIDisplay.renderer.glSetFont(Utils.getFont(small));
if (minus) {
- w1 = glGetStringWidth(Utils.getFont(small), numerator);
+ w1 = PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), numerator);
h1 = Utils.getFont(small).charH;
} else {
w1 = ((Function) var1).getWidth();
@@ -124,15 +121,15 @@ public class Division extends FunctionTwoValues {
maxw = 1 + w2;
}
if (minus && drawMinus) {
- minusw = glGetStringWidth(Utils.getFont(small), "-") + 1;
+ minusw = PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), "-") + 1;
minush = Utils.getFont(small).charH;
- glDrawStringLeft(x+1, y + h1 + 1 + 1 - (minush / 2), "-");
- glDrawStringLeft((int) (x+1 + minusw + 1 + (maxw - w1) / 2d), y, numerator);
+ PIDisplay.renderer.glDrawStringLeft(x+1, y + h1 + 1 + 1 - (minush / 2), "-");
+ PIDisplay.renderer.glDrawStringLeft((int) (x+1 + minusw + 1 + (maxw - w1) / 2d), y, numerator);
} else {
((Function) var1).draw((int) (x+1 + minusw + (maxw - w1) / 2d), y);
}
((Function) var2).draw((int) (x+1 + minusw + (maxw - w2) / 2d), y + h1 + 1 + 1 + 1);
- glFillRect(x+1+ minusw, y + h1 + 1, maxw, 1);
+ PIDisplay.renderer.glFillRect(x+1+ minusw, y + h1 + 1, maxw, 1);
}
@Override
@@ -179,7 +176,7 @@ public class Division extends FunctionTwoValues {
}
int w1 = 0;
if (minus) {
- w1 = glGetStringWidth(Utils.getFont(small), numerator);
+ w1 = PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), numerator);
} else {
w1 = variable1.getWidth();
}
@@ -191,7 +188,7 @@ public class Division extends FunctionTwoValues {
maxw = w2+1;
}
if (minus && drawMinus) {
- return 1 + glGetStringWidth(Utils.getFont(small), "-") + 1 + maxw;
+ return 1 + PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), "-") + 1 + maxw;
} else {
return 1 + maxw;
}
diff --git a/src/org/warp/picalculator/math/functions/EmptyNumber.java b/src/org/warp/picalculator/math/functions/EmptyNumber.java
index 22d9cf1c..65eeab63 100644
--- a/src/org/warp/picalculator/math/functions/EmptyNumber.java
+++ b/src/org/warp/picalculator/math/functions/EmptyNumber.java
@@ -4,7 +4,8 @@ import java.util.List;
import org.warp.picalculator.Error;
import org.warp.picalculator.Utils;
-import org.warp.picalculator.device.graphicengine.Display;
+import org.warp.picalculator.gui.PIDisplay;
+import org.warp.picalculator.gui.graphicengine.cpu.CPUDisplay;
import org.warp.picalculator.math.Calculator;
public class EmptyNumber implements Function {
@@ -38,12 +39,12 @@ public class EmptyNumber implements Function {
@Override
public void draw(int x, int y) {
- Display.Render.glDrawStringLeft(x, y, "␀");
+ PIDisplay.renderer.glDrawStringLeft(x, y, "␀");
}
@Override
public int getWidth() {
- return Display.Render.glGetStringWidth(Utils.getFont(small), "␀");
+ return PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), "␀");
}
@Override
diff --git a/src/org/warp/picalculator/math/functions/Expression.java b/src/org/warp/picalculator/math/functions/Expression.java
index 687ed9f3..2a0cb0f1 100644
--- a/src/org/warp/picalculator/math/functions/Expression.java
+++ b/src/org/warp/picalculator/math/functions/Expression.java
@@ -2,7 +2,6 @@ package org.warp.picalculator.math.functions;
import static org.warp.picalculator.Utils.ArrayToRegex;
import static org.warp.picalculator.Utils.concat;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawLine;
import java.math.BigDecimal;
import java.util.ArrayList;
@@ -13,6 +12,7 @@ import java.util.regex.Pattern;
import org.warp.picalculator.Error;
import org.warp.picalculator.Errors;
import org.warp.picalculator.Utils;
+import org.warp.picalculator.gui.PIDisplay;
import org.warp.picalculator.math.Calculator;
import org.warp.picalculator.math.MathematicalSymbols;
import org.warp.picalculator.math.functions.trigonometry.ArcCosine;
@@ -696,9 +696,9 @@ public class Expression extends FunctionMultipleValues {
float maxy = y + getHeight();
int h = getHeight();
x += 1;
- glDrawLine(x, y + 2, x + 2, y);
- glDrawLine(x, y + 2, x, y + h - 3);
- glDrawLine(x, y + h - 3, x + 2, y + h - 1);
+ PIDisplay.renderer.glDrawLine(x, y + 2, x + 2, y);
+ PIDisplay.renderer.glDrawLine(x, y + 2, x, y + h - 3);
+ PIDisplay.renderer.glDrawLine(x, y + h - 3, x + 2, y + h - 1);
x += 4;
for (Function f : functions) {
float fheight = f.getHeight();
@@ -707,9 +707,9 @@ public class Expression extends FunctionMultipleValues {
x += f.getWidth();
}
x += 2;
- glDrawLine(x, y, x + 2, y + 2);
- glDrawLine(x + 2, y + 2, x + 2, y + h - 3);
- glDrawLine(x, y + h - 1, x + 2, y + h - 3);
+ PIDisplay.renderer.glDrawLine(x, y, x + 2, y + 2);
+ PIDisplay.renderer.glDrawLine(x + 2, y + 2, x + 2, y + h - 3);
+ PIDisplay.renderer.glDrawLine(x, y + h - 1, x + 2, y + h - 3);
x += 4;
}
}
diff --git a/src/org/warp/picalculator/math/functions/FunctionTwoValues.java b/src/org/warp/picalculator/math/functions/FunctionTwoValues.java
index 8074c037..944e61ac 100644
--- a/src/org/warp/picalculator/math/functions/FunctionTwoValues.java
+++ b/src/org/warp/picalculator/math/functions/FunctionTwoValues.java
@@ -1,13 +1,11 @@
package org.warp.picalculator.math.functions;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawStringLeft;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glGetStringWidth;
-
import java.util.ArrayList;
import org.warp.picalculator.Error;
import org.warp.picalculator.Utils;
-import org.warp.picalculator.device.graphicengine.Display;
+import org.warp.picalculator.gui.PIDisplay;
+import org.warp.picalculator.gui.graphicengine.cpu.CPUDisplay;
import org.warp.picalculator.math.Calculator;
import com.rits.cloning.Cloner;
@@ -114,9 +112,9 @@ public abstract class FunctionTwoValues implements Function {
variable1.draw(dx + x, ln - variable1.getLine() + y);
dx += 1+variable1.getWidth();
if (drawSignum()) {
- Display.Render.glSetFont(Utils.getFont(small));
- glDrawStringLeft(dx + x, ln - Utils.getFontHeight(small) / 2 + y, getSymbol());
- dx += glGetStringWidth(Utils.getFont(small), getSymbol());
+ PIDisplay.renderer.glSetFont(Utils.getFont(small));
+ PIDisplay.renderer.glDrawStringLeft(dx + x, ln - Utils.getFontHeight(small) / 2 + y, getSymbol());
+ dx += PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), getSymbol());
}
variable2.draw(dx + x, ln - variable2.getLine() + y);
}
@@ -165,7 +163,7 @@ public abstract class FunctionTwoValues implements Function {
}
protected int calcWidth() {
- return variable1.getWidth() + 1 + (drawSignum() ? glGetStringWidth(Utils.getFont(small), getSymbol()) : 0) + variable2.getWidth();
+ return variable1.getWidth() + 1 + (drawSignum() ? PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), getSymbol()) : 0) + variable2.getWidth();
}
protected int calcHeight() {
diff --git a/src/org/warp/picalculator/math/functions/Joke.java b/src/org/warp/picalculator/math/functions/Joke.java
index a8201aeb..582cc2f7 100644
--- a/src/org/warp/picalculator/math/functions/Joke.java
+++ b/src/org/warp/picalculator/math/functions/Joke.java
@@ -4,9 +4,9 @@ import java.util.List;
import org.warp.picalculator.Error;
import org.warp.picalculator.Utils;
-import org.warp.picalculator.device.PIDisplay;
-import org.warp.picalculator.device.graphicengine.Display;
-import org.warp.picalculator.device.graphicengine.RAWFont;
+import org.warp.picalculator.gui.PIDisplay;
+import org.warp.picalculator.gui.graphicengine.RAWFont;
+import org.warp.picalculator.gui.graphicengine.cpu.CPUDisplay;
import org.warp.picalculator.math.Calculator;
public class Joke implements Function {
@@ -46,22 +46,22 @@ public class Joke implements Function {
@Override
public void draw(int x, int y) {
- RAWFont rf = Display.Render.currentFont;
+ RAWFont rf = PIDisplay.renderer.getCurrentFont();
if (jokesFont[joke] >= 0) {
- Display.Render.glSetFont(PIDisplay.fonts[jokesFont[joke]]);
+ PIDisplay.renderer.glSetFont(PIDisplay.fonts[jokesFont[joke]]);
}
- Display.Render.glDrawStringLeft(x, y, jokes[joke]);
+ PIDisplay.renderer.glDrawStringLeft(x, y, jokes[joke]);
if (jokesFont[joke] >= 0) {
- Display.Render.glSetFont(rf);
+ PIDisplay.renderer.glSetFont(rf);
}
}
@Override
public int getWidth() {
if (jokesFont[joke] >= 0) {
- return Display.Render.glGetStringWidth(PIDisplay.fonts[jokesFont[joke]], jokes[joke]);
+ return PIDisplay.renderer.glGetStringWidth(PIDisplay.fonts[jokesFont[joke]], jokes[joke]);
} else {
- return Display.Render.glGetStringWidth(Utils.getFont(small), jokes[joke]);
+ return PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), jokes[joke]);
}
}
diff --git a/src/org/warp/picalculator/math/functions/Negative.java b/src/org/warp/picalculator/math/functions/Negative.java
index dba70998..5e44c8cb 100644
--- a/src/org/warp/picalculator/math/functions/Negative.java
+++ b/src/org/warp/picalculator/math/functions/Negative.java
@@ -5,7 +5,8 @@ import java.util.ArrayList;
import org.warp.picalculator.Error;
import org.warp.picalculator.Errors;
import org.warp.picalculator.Utils;
-import org.warp.picalculator.device.graphicengine.Display;
+import org.warp.picalculator.gui.PIDisplay;
+import org.warp.picalculator.gui.graphicengine.cpu.CPUDisplay;
import org.warp.picalculator.math.Calculator;
import org.warp.picalculator.math.MathematicalSymbols;
import org.warp.picalculator.math.rules.ExpandRule1;
@@ -33,7 +34,7 @@ public class Negative extends AnteriorFunction {
variable.generateGraphics();
height = getVariable().getHeight();
- width = Display.Render.glGetStringWidth(Utils.getFont(small), "-") + getVariable().getWidth();
+ width = PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), "-") + getVariable().getWidth();
line = getVariable().getLine();
}
diff --git a/src/org/warp/picalculator/math/functions/Number.java b/src/org/warp/picalculator/math/functions/Number.java
index 1f357449..f3a2f25b 100644
--- a/src/org/warp/picalculator/math/functions/Number.java
+++ b/src/org/warp/picalculator/math/functions/Number.java
@@ -1,8 +1,5 @@
package org.warp.picalculator.math.functions;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawStringLeft;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glGetStringWidth;
-
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
@@ -12,8 +9,9 @@ import java.util.List;
import org.nevec.rjm.BigDecimalMath;
import org.warp.picalculator.Error;
import org.warp.picalculator.Utils;
-import org.warp.picalculator.device.graphicengine.Display;
-import org.warp.picalculator.device.graphicengine.RAWFont;
+import org.warp.picalculator.gui.PIDisplay;
+import org.warp.picalculator.gui.graphicengine.RAWFont;
+import org.warp.picalculator.gui.graphicengine.cpu.CPUDisplay;
import org.warp.picalculator.math.Calculator;
import com.rits.cloning.Cloner;
@@ -133,7 +131,7 @@ public class Number implements Function {
@Override
public void draw(int x, int y) {
- Display.Render.glSetFont(Utils.getFont(small));
+ PIDisplay.renderer.glSetFont(Utils.getFont(small));
String t = toString();
if (t.startsWith("-")) {
@@ -147,12 +145,12 @@ public class Number implements Function {
final RAWFont defaultf = Utils.getFont(small);
final RAWFont smallf = Utils.getFont(true);
String s = t.substring(0, t.indexOf("ℯ℮")+2);
- int sw = glGetStringWidth(defaultf, s);
- glDrawStringLeft(x+1, y+smallf.charH-2, s);
- Display.Render.glSetFont(smallf);
- glDrawStringLeft(x+1+sw-3, y, t.substring(t.indexOf("ℯ℮")+2));
+ int sw = PIDisplay.renderer.glGetStringWidth(defaultf, s);
+ PIDisplay.renderer.glDrawStringLeft(x+1, y+smallf.charH-2, s);
+ PIDisplay.renderer.glSetFont(smallf);
+ PIDisplay.renderer.glDrawStringLeft(x+1+sw-3, y, t.substring(t.indexOf("ℯ℮")+2));
} else {
- glDrawStringLeft(x+1, y, t);
+ PIDisplay.renderer.glDrawStringLeft(x+1, y, t);
}
}
@@ -196,10 +194,10 @@ public class Number implements Function {
final RAWFont defaultf = Utils.getFont(small);
final RAWFont smallf = Utils.getFont(true);
String s = t.substring(0, t.indexOf("ℯ℮")+2);
- int sw = glGetStringWidth(defaultf, s);
- return 1+sw-3+glGetStringWidth(smallf, t.substring(t.indexOf("ℯ℮")+2));
+ int sw = PIDisplay.renderer.glGetStringWidth(defaultf, s);
+ return 1+sw-3+PIDisplay.renderer.glGetStringWidth(smallf, t.substring(t.indexOf("ℯ℮")+2));
} else {
- return glGetStringWidth(Utils.getFont(small), t)+1;
+ return PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), t)+1;
}
}
diff --git a/src/org/warp/picalculator/math/functions/Root.java b/src/org/warp/picalculator/math/functions/Root.java
index 359ff25e..1a65cd47 100644
--- a/src/org/warp/picalculator/math/functions/Root.java
+++ b/src/org/warp/picalculator/math/functions/Root.java
@@ -1,12 +1,11 @@
package org.warp.picalculator.math.functions;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawLine;
-
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import org.warp.picalculator.Error;
+import org.warp.picalculator.gui.PIDisplay;
import org.warp.picalculator.math.Calculator;
import org.warp.picalculator.math.MathematicalSymbols;
@@ -99,10 +98,10 @@ public class Root extends FunctionTwoValues {
getVariable1().draw(x + 1, y);
getVariable2().draw(x + 1 + w2 + 2, y + h2 - 2);
- glDrawLine(x + 1 + w2 - 2, y + height - 3, x + 1 + w2, y + height);
- glDrawLine(x + 1 + w2, y + height - 1 - hh, x + 1 + w2, y + height - 1);
- glDrawLine(x + 1 + w2 + 1, y + height - 2 - h1, x + 1 + w2 + 1, y + height - 1 - hh - 1);
- glDrawLine(x + 1 + w2 + 1, y + height - h1 - 2, x + 1 + w2 + 2 + w1 + 1, y + height - h1 - 2);
+ PIDisplay.renderer.glDrawLine(x + 1 + w2 - 2, y + height - 3, x + 1 + w2, y + height);
+ PIDisplay.renderer.glDrawLine(x + 1 + w2, y + height - 1 - hh, x + 1 + w2, y + height - 1);
+ PIDisplay.renderer.glDrawLine(x + 1 + w2 + 1, y + height - 2 - h1, x + 1 + w2 + 1, y + height - 1 - hh - 1);
+ PIDisplay.renderer.glDrawLine(x + 1 + w2 + 1, y + height - h1 - 2, x + 1 + w2 + 2 + w1 + 1, y + height - h1 - 2);
}
@Override
diff --git a/src/org/warp/picalculator/math/functions/Sum.java b/src/org/warp/picalculator/math/functions/Sum.java
index 6df3d953..d28f1e78 100644
--- a/src/org/warp/picalculator/math/functions/Sum.java
+++ b/src/org/warp/picalculator/math/functions/Sum.java
@@ -1,13 +1,12 @@
package org.warp.picalculator.math.functions;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glGetStringWidth;
-
import java.math.BigDecimal;
import java.util.ArrayList;
import org.warp.picalculator.Error;
import org.warp.picalculator.Errors;
import org.warp.picalculator.Utils;
+import org.warp.picalculator.gui.PIDisplay;
import org.warp.picalculator.math.Calculator;
import org.warp.picalculator.math.MathematicalSymbols;
import org.warp.picalculator.math.rules.NumberRule3;
@@ -114,7 +113,7 @@ public class Sum extends FunctionTwoValues {
int dx = 0;
dx += variable1.getWidth();
dx += 1;
- dx += glGetStringWidth(Utils.getFont(small), getSymbol());
+ dx += PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), getSymbol());
return dx += variable2.getWidth();
}
diff --git a/src/org/warp/picalculator/math/functions/SumSubtraction.java b/src/org/warp/picalculator/math/functions/SumSubtraction.java
index 8172c4eb..d90f3148 100644
--- a/src/org/warp/picalculator/math/functions/SumSubtraction.java
+++ b/src/org/warp/picalculator/math/functions/SumSubtraction.java
@@ -1,14 +1,12 @@
package org.warp.picalculator.math.functions;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawStringLeft;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glGetStringWidth;
-
import java.util.ArrayList;
import org.warp.picalculator.Error;
import org.warp.picalculator.Errors;
import org.warp.picalculator.Utils;
-import org.warp.picalculator.device.graphicengine.Display;
+import org.warp.picalculator.gui.PIDisplay;
+import org.warp.picalculator.gui.graphicengine.cpu.CPUDisplay;
import org.warp.picalculator.math.Calculator;
import org.warp.picalculator.math.MathematicalSymbols;
import org.warp.picalculator.math.rules.ExpandRule1;
@@ -88,10 +86,10 @@ public class SumSubtraction extends FunctionTwoValues {
int dx = 0;
variable1.draw(dx + x, ln - variable1.getLine() + y);
dx += variable1.getWidth();
- Display.Render.glSetFont(Utils.getFont(small));
+ PIDisplay.renderer.glSetFont(Utils.getFont(small));
dx += 1;
- glDrawStringLeft(dx + x, ln - Utils.getFontHeight(small) / 2 + y, getSymbol());
- dx += glGetStringWidth(Utils.getFont(small), getSymbol());
+ PIDisplay.renderer.glDrawStringLeft(dx + x, ln - Utils.getFontHeight(small) / 2 + y, getSymbol());
+ dx += PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), getSymbol());
variable2.draw(dx + x, ln - variable2.getLine() + y);
}
@@ -105,7 +103,7 @@ public class SumSubtraction extends FunctionTwoValues {
int dx = 0;
dx += variable1.getWidth();
dx += 1;
- dx += glGetStringWidth(Utils.getFont(small), getSymbol());
+ dx += PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), getSymbol());
return dx += variable2.getWidth();
}
diff --git a/src/org/warp/picalculator/math/functions/Undefined.java b/src/org/warp/picalculator/math/functions/Undefined.java
index 90562ad4..d73a9cd7 100644
--- a/src/org/warp/picalculator/math/functions/Undefined.java
+++ b/src/org/warp/picalculator/math/functions/Undefined.java
@@ -4,7 +4,8 @@ import java.util.List;
import org.warp.picalculator.Error;
import org.warp.picalculator.Utils;
-import org.warp.picalculator.device.graphicengine.Display;
+import org.warp.picalculator.gui.PIDisplay;
+import org.warp.picalculator.gui.graphicengine.cpu.CPUDisplay;
import org.warp.picalculator.math.Calculator;
public class Undefined implements Function {
@@ -35,15 +36,15 @@ public class Undefined implements Function {
@Override
public void generateGraphics() {
- width = Display.Render.glGetStringWidth(Utils.getFont(small), "UNDEFINED");
+ width = PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), "UNDEFINED");
height = Utils.getFontHeight(small);
line = height/2;
}
@Override
public void draw(int x, int y) {
- Display.Render.glSetFont(Utils.getFont(small));
- Display.Render.glDrawStringLeft(x, y, "UNDEFINED");
+ PIDisplay.renderer.glSetFont(Utils.getFont(small));
+ PIDisplay.renderer.glDrawStringLeft(x, y, "UNDEFINED");
}
@Override
diff --git a/src/org/warp/picalculator/math/functions/Variable.java b/src/org/warp/picalculator/math/functions/Variable.java
index 50e03a4b..d5b5096c 100644
--- a/src/org/warp/picalculator/math/functions/Variable.java
+++ b/src/org/warp/picalculator/math/functions/Variable.java
@@ -1,14 +1,11 @@
package org.warp.picalculator.math.functions;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawStringLeft;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glGetStringWidth;
-
import java.util.ArrayList;
import java.util.List;
import org.warp.picalculator.Error;
import org.warp.picalculator.Utils;
-import org.warp.picalculator.device.graphicengine.Display;
+import org.warp.picalculator.gui.PIDisplay;
import org.warp.picalculator.math.Calculator;
import com.rits.cloning.Cloner;
@@ -65,8 +62,8 @@ public class Variable implements Function {
@Override
public void draw(int x, int y) {
- Display.Render.glSetFont(Utils.getFont(small));
- glDrawStringLeft(x+1, y, toString());
+ PIDisplay.renderer.glSetFont(Utils.getFont(small));
+ PIDisplay.renderer.glDrawStringLeft(x+1, y, toString());
}
@Override
@@ -85,7 +82,7 @@ public class Variable implements Function {
}
public int calcWidth() {
- return glGetStringWidth(Utils.getFont(small), toString())+1;
+ return PIDisplay.renderer.glGetStringWidth(Utils.getFont(small), toString())+1;
}
@Override
diff --git a/src/org/warp/picalculator/math/functions/equations/EquationsSystem.java b/src/org/warp/picalculator/math/functions/equations/EquationsSystem.java
index 7c8f9403..04ddb820 100644
--- a/src/org/warp/picalculator/math/functions/equations/EquationsSystem.java
+++ b/src/org/warp/picalculator/math/functions/equations/EquationsSystem.java
@@ -1,11 +1,10 @@
package org.warp.picalculator.math.functions.equations;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawLine;
-
import java.util.ArrayList;
import java.util.List;
import org.warp.picalculator.Error;
+import org.warp.picalculator.gui.PIDisplay;
import org.warp.picalculator.math.Calculator;
import org.warp.picalculator.math.functions.Expression;
import org.warp.picalculator.math.functions.Function;
@@ -109,13 +108,13 @@ public class EquationsSystem extends FunctionMultipleValues {
}
- glDrawLine(x + 2, y + 0, x + 3, y + 0);
- glDrawLine(x + 1, y + 1, x + 1, y + marginBottom / 2);
- glDrawLine(x + 2, y + marginBottom / 2 + 1, x + 2, y + marginBottom - 1);
- glDrawLine(x + 0, y + marginBottom, x + 1, y + marginBottom);
- glDrawLine(x + 2, y + marginBottom + 1, x + 2, y + marginBottom + spazioSopra / 2 - 1);
- glDrawLine(x + 1, y + marginBottom + spazioSopra / 2, x + 1, y + h - 1);
- glDrawLine(x + 2, y + h, x + 3, y + h);
+ PIDisplay.renderer.glDrawLine(x + 2, y + 0, x + 3, y + 0);
+ PIDisplay.renderer.glDrawLine(x + 1, y + 1, x + 1, y + marginBottom / 2);
+ PIDisplay.renderer.glDrawLine(x + 2, y + marginBottom / 2 + 1, x + 2, y + marginBottom - 1);
+ PIDisplay.renderer.glDrawLine(x + 0, y + marginBottom, x + 1, y + marginBottom);
+ PIDisplay.renderer.glDrawLine(x + 2, y + marginBottom + 1, x + 2, y + marginBottom + spazioSopra / 2 - 1);
+ PIDisplay.renderer.glDrawLine(x + 1, y + marginBottom + spazioSopra / 2, x + 1, y + h - 1);
+ PIDisplay.renderer.glDrawLine(x + 2, y + h, x + 3, y + h);
}
@Override
diff --git a/src/org/warp/picalculator/math/functions/equations/EquationsSystemPart.java b/src/org/warp/picalculator/math/functions/equations/EquationsSystemPart.java
index f9435bd7..15538b56 100644
--- a/src/org/warp/picalculator/math/functions/equations/EquationsSystemPart.java
+++ b/src/org/warp/picalculator/math/functions/equations/EquationsSystemPart.java
@@ -1,6 +1,6 @@
package org.warp.picalculator.math.functions.equations;
-import static org.warp.picalculator.device.graphicengine.Display.Render.glDrawLine;
+import static org.warp.picalculator.gui.graphicengine.cpu.CPUDisplay.Render.glDrawLine;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/org/warp/picalculator/math/rules/NumberRule2.java b/src/org/warp/picalculator/math/rules/NumberRule2.java
index e7f23c7d..bec01ff1 100644
--- a/src/org/warp/picalculator/math/rules/NumberRule2.java
+++ b/src/org/warp/picalculator/math/rules/NumberRule2.java
@@ -55,7 +55,7 @@ public class NumberRule2 {
}
}
- result.add(a.setParent(root));
+ result.add(a);
return result;
}
diff --git a/src/org/warp/picalculator/math/rules/SyntaxRule2.java b/src/org/warp/picalculator/math/rules/SyntaxRule2.java
index e53d7aab..2e5266f5 100644
--- a/src/org/warp/picalculator/math/rules/SyntaxRule2.java
+++ b/src/org/warp/picalculator/math/rules/SyntaxRule2.java
@@ -3,6 +3,7 @@ package org.warp.picalculator.math.rules;
import java.util.ArrayList;
import org.warp.picalculator.Error;
+import org.warp.picalculator.math.Calculator;
import org.warp.picalculator.math.functions.Expression;
import org.warp.picalculator.math.functions.Function;
import org.warp.picalculator.math.functions.Sum;
diff --git a/test.png b/test.png
new file mode 100644
index 00000000..703116f8
Binary files /dev/null and b/test.png differ