summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-03-11 07:08:56 +0100
committerSven Gothel <[email protected]>2023-03-11 07:08:56 +0100
commitd27baa9f6980d6e2b570999607b003a11393ea95 (patch)
treed0cf9a8469f9acfce294943fa2d6efd1d7cc9ca1 /src
parent32f245d0ad381828c2c731840e2d978e8cbc3df3 (diff)
Cleanup Demos: Move demos to jogl-demos.jar (here Graph + AudioVideo), ready for easy deployment and test w/ junit/ant
Diffstat (limited to 'src')
-rw-r--r--src/demos/com/jogamp/opengl/demos/Launcher0.java1
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/LauncherUtil.java (renamed from src/test/com/jogamp/opengl/test/android/LauncherUtil.java)2
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/MovieCubeActivity0a.java (renamed from src/test/com/jogamp/opengl/test/android/MovieCubeActivity0a.java)4
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/MovieCubeActivity0b.java (renamed from src/test/com/jogamp/opengl/test/android/MovieCubeActivity0b.java)4
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/MovieCubeActivityLauncher0a.java (renamed from src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0a.java)5
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/MovieCubeActivityLauncher0b.java (renamed from src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0b.java)5
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/MovieCubeActivityLauncher1a.java (renamed from src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1a.java)5
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/MovieCubeActivityLauncher1b.java (renamed from src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1b.java)5
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivity0.java (renamed from src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java)4
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivity1.java (renamed from src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java)4
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivityLauncher00b.java (renamed from src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00b.java)5
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivityLauncher00c.java (renamed from src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00c.java)5
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivityLauncher01a.java (renamed from src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher01a.java)5
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivityLauncher01b.java (renamed from src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher01b.java)5
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivityLauncher02.java (renamed from src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher02.java)5
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2Activity.java (renamed from src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java)5
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2ActivityLauncher.java (renamed from src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java)4
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2ECTActivityLauncher.java (renamed from src/test/com/jogamp/opengl/test/android/NEWTGearsES2ECTActivityLauncher.java)4
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2RGB565ActivityLauncher.java (renamed from src/test/com/jogamp/opengl/test/android/NEWTGearsES2RGB565ActivityLauncher.java)4
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2TransActivity.java (renamed from src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivity.java)4
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2TransActivityLauncher.java (renamed from src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivityLauncher.java)4
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/NEWTGraphUI1pActivity.java (renamed from src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivity.java)4
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/NEWTGraphUI1pActivityLauncher.java (renamed from src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivityLauncher.java)5
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/NEWTGraphUI2pActivity.java (renamed from src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivity.java)4
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/NEWTGraphUI2pActivityLauncher.java (renamed from src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivityLauncher.java)5
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/NEWTRedSquareES2Activity.java (renamed from src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2Activity.java)4
-rw-r--r--src/demos/com/jogamp/opengl/demos/android/NEWTRedSquareES2ActivityLauncher.java (renamed from src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2ActivityLauncher.java)2
-rw-r--r--src/demos/com/jogamp/opengl/demos/av/CrossFadePlayer.java (renamed from src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/CrossFadePlayer.java)2
-rw-r--r--src/demos/com/jogamp/opengl/demos/av/MovieCube.java (renamed from src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java)8
-rw-r--r--src/demos/com/jogamp/opengl/demos/av/MovieSBSStereo.java (renamed from src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSBSStereo.java)5
-rw-r--r--src/demos/com/jogamp/opengl/demos/av/MovieSimple.java (renamed from src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java)32
-rw-r--r--src/demos/com/jogamp/opengl/demos/av/StereoDemo01.java (renamed from src/test/com/jogamp/opengl/test/junit/jogl/stereo/StereoDemo01.java)11
-rw-r--r--src/demos/com/jogamp/opengl/demos/es2/GearsES2.java3
-rw-r--r--src/demos/com/jogamp/opengl/demos/es2/GearsObjectES2.java4
-rw-r--r--src/demos/com/jogamp/opengl/demos/es2/TextureSequenceCubeES2.java491
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/FontSetDemos.java35
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener00.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener00.java)2
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener01.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java)2
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener10.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener10.java)2
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/GPURegionNewtDemo.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo.java)5
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/GPURendererListenerBase01.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java)2
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/GPUTextGLListener0A.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java)2
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/GPUTextNewtDemo.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo.java)4
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/GPUTextRendererListenerBase01.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java)2
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/MSAATool.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/demos/MSAATool.java)2
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/TextRendererGLELBase.java291
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeMono.ttfbin0 -> 592632 bytes
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeMonoBold.ttfbin0 -> 299136 bytes
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeMonoBoldOblique.ttfbin0 -> 298940 bytes
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeMonoOblique.ttfbin0 -> 395188 bytes
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSans.ttfbin0 -> 1563256 bytes
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSansBold.ttfbin0 -> 416128 bytes
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSansBoldOblique.ttfbin0 -> 342492 bytes
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSansOblique.ttfbin0 -> 763676 bytes
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSerif.ttfbin0 -> 3303588 bytes
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSerifBold.ttfbin0 -> 1310828 bytes
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSerifBoldItalic.ttfbin0 -> 608676 bytes
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSerifItalic.ttfbin0 -> 922104 bytes
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/GPUUISceneGLListener0A.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/ui/demos/GPUUISceneGLListener0A.java)124
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/GPUUISceneNewtDemo.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/ui/demos/GPUUISceneNewtDemo.java)12
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/GPUUISceneTextAnim01.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/ui/demos/GPUUISceneTextAnim01.java)28
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/UIShapeDemo01.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/ui/demos/UIShapeDemo01.java)18
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/UITypeDemo01.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/ui/demos/UITypeDemo01.java)28
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/button-pressed-145x53.png (renamed from src/test/com/jogamp/opengl/test/junit/graph/ui/demos/button-pressed-145x53.png)bin8603 -> 8603 bytes
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/button-released-145x53.png (renamed from src/test/com/jogamp/opengl/test/junit/graph/ui/demos/button-released-145x53.png)bin9429 -> 9429 bytes
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/testshapes/Glyph01UbuntuLight_o.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/ui/testshapes/Glyph01UbuntuLight_o.java)2
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/testshapes/Glyph02UbuntuLight_ae.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/ui/testshapes/Glyph02UbuntuLight_ae.java)2
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/testshapes/Glyph03FreeMonoRegular_M.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/ui/testshapes/Glyph03FreeMonoRegular_M.java)2
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/testshapes/Glyph04FreeSans_0.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/ui/testshapes/Glyph04FreeSans_0.java)2
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/testshapes/Glyph05FreeSerifBoldItalic_ae.java (renamed from src/test/com/jogamp/opengl/test/junit/graph/ui/testshapes/Glyph05FreeSerifBoldItalic_ae.java)2
-rw-r--r--src/demos/com/jogamp/opengl/demos/util/MiscUtils.java (renamed from src/demos/com/jogamp/opengl/demos/MiscUtils.java)2
-rw-r--r--src/demos/com/jogamp/opengl/demos/util/QuitAdapter.java64
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTElektronActivity.java78
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTElektronActivityLauncher.java51
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGearsES1Activity.java83
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGearsES1ActivityLauncher.java50
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1Activity.java77
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1ActivityLauncher.java51
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/GPURegionGLListener01.java299
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/GPURegionGLListener10.java138
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/GPURendererListenerBase01.java361
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/GPUTextRendererListenerBase01.java588
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/MSAATool.java96
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java3
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT20.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/ui/demos/GPUUISceneNewtCanvasAWTDemo.java220
86 files changed, 2582 insertions, 819 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/Launcher0.java b/src/demos/com/jogamp/opengl/demos/Launcher0.java
index 9f2e0d64e..d9d66d434 100644
--- a/src/demos/com/jogamp/opengl/demos/Launcher0.java
+++ b/src/demos/com/jogamp/opengl/demos/Launcher0.java
@@ -56,6 +56,7 @@ import com.jogamp.opengl.GLEventListener;
import com.jogamp.opengl.GLPipelineFactory;
import com.jogamp.opengl.GLProfile;
import com.jogamp.opengl.demos.es2.RedSquareES2;
+import com.jogamp.opengl.demos.util.MiscUtils;
/**
* <p>
diff --git a/src/test/com/jogamp/opengl/test/android/LauncherUtil.java b/src/demos/com/jogamp/opengl/demos/android/LauncherUtil.java
index 11dbe12cf..f512e467e 100644
--- a/src/test/com/jogamp/opengl/test/android/LauncherUtil.java
+++ b/src/demos/com/jogamp/opengl/demos/android/LauncherUtil.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.util.ArrayList;
import java.util.HashMap;
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0a.java b/src/demos/com/jogamp/opengl/demos/android/MovieCubeActivity0a.java
index 8555d4155..cdbaa7872 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0a.java
+++ b/src/demos/com/jogamp/opengl/demos/android/MovieCubeActivity0a.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.io.IOException;
import java.net.HttpURLConnection;
@@ -35,6 +35,7 @@ import java.util.Arrays;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
+import com.jogamp.opengl.demos.av.MovieCube;
import jogamp.newt.driver.android.NewtBaseActivity;
@@ -44,7 +45,6 @@ import com.jogamp.newt.NewtFactory;
import com.jogamp.newt.event.MouseAdapter;
import com.jogamp.newt.event.MouseEvent;
import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.av.GLMediaPlayer;
import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener;
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0b.java b/src/demos/com/jogamp/opengl/demos/android/MovieCubeActivity0b.java
index 841404516..b04487b5f 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0b.java
+++ b/src/demos/com/jogamp/opengl/demos/android/MovieCubeActivity0b.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.io.IOException;
import java.net.HttpURLConnection;
@@ -35,6 +35,7 @@ import java.util.Arrays;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
+import com.jogamp.opengl.demos.av.MovieCube;
import jogamp.newt.driver.android.NewtBaseActivity;
@@ -44,7 +45,6 @@ import com.jogamp.newt.NewtFactory;
import com.jogamp.newt.event.MouseAdapter;
import com.jogamp.newt.event.MouseEvent;
import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.av.GLMediaPlayer;
import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener;
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0a.java b/src/demos/com/jogamp/opengl/demos/android/MovieCubeActivityLauncher0a.java
index a8223a76f..4c9409b02 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0a.java
+++ b/src/demos/com/jogamp/opengl/demos/android/MovieCubeActivityLauncher0a.java
@@ -25,12 +25,13 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.util.Arrays;
import java.util.List;
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+import com.jogamp.opengl.demos.android.LauncherUtil.BaseActivityLauncher;
+import com.jogamp.opengl.demos.android.LauncherUtil.OrderedProperties;
public class MovieCubeActivityLauncher0a extends LauncherUtil.BaseActivityLauncher {
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0b.java b/src/demos/com/jogamp/opengl/demos/android/MovieCubeActivityLauncher0b.java
index 3286f673a..548c0bc51 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0b.java
+++ b/src/demos/com/jogamp/opengl/demos/android/MovieCubeActivityLauncher0b.java
@@ -25,12 +25,13 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.util.Arrays;
import java.util.List;
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+import com.jogamp.opengl.demos.android.LauncherUtil.BaseActivityLauncher;
+import com.jogamp.opengl.demos.android.LauncherUtil.OrderedProperties;
public class MovieCubeActivityLauncher0b extends LauncherUtil.BaseActivityLauncher {
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1a.java b/src/demos/com/jogamp/opengl/demos/android/MovieCubeActivityLauncher1a.java
index 1b1743f5b..d4133df18 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1a.java
+++ b/src/demos/com/jogamp/opengl/demos/android/MovieCubeActivityLauncher1a.java
@@ -25,12 +25,13 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.util.Arrays;
import java.util.List;
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+import com.jogamp.opengl.demos.android.LauncherUtil.BaseActivityLauncher;
+import com.jogamp.opengl.demos.android.LauncherUtil.OrderedProperties;
public class MovieCubeActivityLauncher1a extends LauncherUtil.BaseActivityLauncher {
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1b.java b/src/demos/com/jogamp/opengl/demos/android/MovieCubeActivityLauncher1b.java
index 5135122a1..21749ef74 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1b.java
+++ b/src/demos/com/jogamp/opengl/demos/android/MovieCubeActivityLauncher1b.java
@@ -25,12 +25,13 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.util.Arrays;
import java.util.List;
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+import com.jogamp.opengl.demos.android.LauncherUtil.BaseActivityLauncher;
+import com.jogamp.opengl.demos.android.LauncherUtil.OrderedProperties;
public class MovieCubeActivityLauncher1b extends LauncherUtil.BaseActivityLauncher {
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java b/src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivity0.java
index e6aba9455..07d0b9914 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
+++ b/src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivity0.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.net.HttpURLConnection;
import java.net.URISyntaxException;
@@ -34,6 +34,7 @@ import java.util.Arrays;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
+import com.jogamp.opengl.demos.av.MovieSimple;
import jogamp.newt.driver.android.NewtBaseActivity;
@@ -44,7 +45,6 @@ import com.jogamp.newt.Window;
import com.jogamp.newt.event.MouseAdapter;
import com.jogamp.newt.event.MouseEvent;
import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.av.GLMediaPlayer;
import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener;
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java b/src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivity1.java
index 086532015..d7a2aeae1 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
+++ b/src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivity1.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.net.HttpURLConnection;
import java.net.URISyntaxException;
@@ -37,6 +37,7 @@ import com.jogamp.opengl.GLAutoDrawable;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
import com.jogamp.opengl.GLRunnable;
+import com.jogamp.opengl.demos.av.MovieSimple;
import jogamp.newt.driver.android.NewtBaseActivity;
@@ -47,7 +48,6 @@ import com.jogamp.newt.Window;
import com.jogamp.newt.event.MouseAdapter;
import com.jogamp.newt.event.MouseEvent;
import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.av.GLMediaPlayer;
import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener;
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00b.java b/src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivityLauncher00b.java
index 38b7a71db..bfcf3dd06 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00b.java
+++ b/src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivityLauncher00b.java
@@ -25,12 +25,13 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.util.Arrays;
import java.util.List;
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+import com.jogamp.opengl.demos.android.LauncherUtil.BaseActivityLauncher;
+import com.jogamp.opengl.demos.android.LauncherUtil.OrderedProperties;
public class MovieSimpleActivityLauncher00b extends LauncherUtil.BaseActivityLauncher {
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00c.java b/src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivityLauncher00c.java
index a65896339..947e848c5 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00c.java
+++ b/src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivityLauncher00c.java
@@ -25,12 +25,13 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.util.Arrays;
import java.util.List;
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+import com.jogamp.opengl.demos.android.LauncherUtil.BaseActivityLauncher;
+import com.jogamp.opengl.demos.android.LauncherUtil.OrderedProperties;
public class MovieSimpleActivityLauncher00c extends LauncherUtil.BaseActivityLauncher {
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher01a.java b/src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivityLauncher01a.java
index 739838347..bf9114f4f 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher01a.java
+++ b/src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivityLauncher01a.java
@@ -25,12 +25,13 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.util.Arrays;
import java.util.List;
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+import com.jogamp.opengl.demos.android.LauncherUtil.BaseActivityLauncher;
+import com.jogamp.opengl.demos.android.LauncherUtil.OrderedProperties;
public class MovieSimpleActivityLauncher01a extends LauncherUtil.BaseActivityLauncher {
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher01b.java b/src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivityLauncher01b.java
index d5918f84e..35330b86b 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher01b.java
+++ b/src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivityLauncher01b.java
@@ -25,12 +25,13 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.util.Arrays;
import java.util.List;
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+import com.jogamp.opengl.demos.android.LauncherUtil.BaseActivityLauncher;
+import com.jogamp.opengl.demos.android.LauncherUtil.OrderedProperties;
public class MovieSimpleActivityLauncher01b extends LauncherUtil.BaseActivityLauncher {
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher02.java b/src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivityLauncher02.java
index 9bc85b6b0..d7c064a28 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher02.java
+++ b/src/demos/com/jogamp/opengl/demos/android/MovieSimpleActivityLauncher02.java
@@ -25,12 +25,13 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.util.Arrays;
import java.util.List;
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+import com.jogamp.opengl.demos.android.LauncherUtil.BaseActivityLauncher;
+import com.jogamp.opengl.demos.android.LauncherUtil.OrderedProperties;
public class MovieSimpleActivityLauncher02 extends LauncherUtil.BaseActivityLauncher {
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java b/src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2Activity.java
index eff2aae49..8ab927487 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java
+++ b/src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2Activity.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.nio.Buffer;
import java.nio.ByteBuffer;
@@ -33,6 +33,7 @@ import java.util.ArrayList;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
+import com.jogamp.opengl.demos.es2.GearsES2;
import jogamp.newt.driver.android.NewtBaseActivity;
@@ -43,7 +44,6 @@ import com.jogamp.newt.event.MouseEvent;
import com.jogamp.newt.event.MonitorModeListener;
import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
import com.jogamp.opengl.util.Animator;
import android.os.Bundle;
@@ -92,6 +92,7 @@ public class NEWTGearsES2Activity extends NewtBaseActivity {
if( e.getPointerCount() == 3 ) {
Log.d(TAG, "MemoryHog");
new InterruptSource.Thread(null, new Runnable() {
+ @Override
public void run() {
final ArrayList<Buffer> buffers = new ArrayList<Buffer>();
while(true) {
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java b/src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2ActivityLauncher.java
index aea2f24cd..a945baeab 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java
+++ b/src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2ActivityLauncher.java
@@ -25,12 +25,12 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.util.Arrays;
import java.util.List;
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+import com.jogamp.opengl.demos.android.LauncherUtil.OrderedProperties;
public class NEWTGearsES2ActivityLauncher extends LauncherUtil.BaseActivityLauncher {
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ECTActivityLauncher.java b/src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2ECTActivityLauncher.java
index 7454058fa..b627c6638 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ECTActivityLauncher.java
+++ b/src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2ECTActivityLauncher.java
@@ -25,12 +25,12 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.util.Arrays;
import java.util.List;
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+import com.jogamp.opengl.demos.android.LauncherUtil.OrderedProperties;
public class NEWTGearsES2ECTActivityLauncher extends LauncherUtil.BaseActivityLauncher {
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2RGB565ActivityLauncher.java b/src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2RGB565ActivityLauncher.java
index 7e20596cb..5ab877b35 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2RGB565ActivityLauncher.java
+++ b/src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2RGB565ActivityLauncher.java
@@ -25,12 +25,12 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.util.Arrays;
import java.util.List;
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+import com.jogamp.opengl.demos.android.LauncherUtil.OrderedProperties;
public class NEWTGearsES2RGB565ActivityLauncher extends LauncherUtil.BaseActivityLauncher {
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivity.java b/src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2TransActivity.java
index ebf8f35d6..8d945aad0 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivity.java
+++ b/src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2TransActivity.java
@@ -25,10 +25,11 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
+import com.jogamp.opengl.demos.es2.GearsES2;
import jogamp.newt.driver.android.NewtBaseActivity;
@@ -38,7 +39,6 @@ import com.jogamp.newt.event.MonitorEvent;
import com.jogamp.newt.event.MonitorModeListener;
import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
import com.jogamp.opengl.util.Animator;
import android.os.Bundle;
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivityLauncher.java b/src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2TransActivityLauncher.java
index 590199ff9..7a44a495b 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivityLauncher.java
+++ b/src/demos/com/jogamp/opengl/demos/android/NEWTGearsES2TransActivityLauncher.java
@@ -1,9 +1,9 @@
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.util.Arrays;
import java.util.List;
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+import com.jogamp.opengl.demos.android.LauncherUtil.OrderedProperties;
public class NEWTGearsES2TransActivityLauncher extends LauncherUtil.BaseActivityLauncher {
static String demo = "com.jogamp.opengl.test.android.NEWTGearsES2TransActivity";
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivity.java b/src/demos/com/jogamp/opengl/demos/android/NEWTGraphUI1pActivity.java
index a272490bf..ea512375f 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivity.java
+++ b/src/demos/com/jogamp/opengl/demos/android/NEWTGraphUI1pActivity.java
@@ -25,11 +25,11 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
-import com.jogamp.opengl.test.junit.graph.ui.demos.GPUUISceneGLListener0A;
+import com.jogamp.opengl.demos.graph.ui.GPUUISceneGLListener0A;
import jogamp.newt.driver.android.NewtBaseActivity;
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivityLauncher.java b/src/demos/com/jogamp/opengl/demos/android/NEWTGraphUI1pActivityLauncher.java
index 27b367772..796cff268 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivityLauncher.java
+++ b/src/demos/com/jogamp/opengl/demos/android/NEWTGraphUI1pActivityLauncher.java
@@ -1,9 +1,10 @@
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.util.Arrays;
import java.util.List;
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+import com.jogamp.opengl.demos.android.LauncherUtil.BaseActivityLauncher;
+import com.jogamp.opengl.demos.android.LauncherUtil.OrderedProperties;
public class NEWTGraphUI1pActivityLauncher extends LauncherUtil.BaseActivityLauncher {
static String demo = "com.jogamp.opengl.test.android.NEWTGraphUI1pActivity";
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivity.java b/src/demos/com/jogamp/opengl/demos/android/NEWTGraphUI2pActivity.java
index 0acc87690..ede8a5d31 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivity.java
+++ b/src/demos/com/jogamp/opengl/demos/android/NEWTGraphUI2pActivity.java
@@ -25,11 +25,11 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
-import com.jogamp.opengl.test.junit.graph.ui.demos.GPUUISceneGLListener0A;
+import com.jogamp.opengl.demos.graph.ui.GPUUISceneGLListener0A;
import jogamp.newt.driver.android.NewtBaseActivity;
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivityLauncher.java b/src/demos/com/jogamp/opengl/demos/android/NEWTGraphUI2pActivityLauncher.java
index 349d2a17e..3d6b7991d 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivityLauncher.java
+++ b/src/demos/com/jogamp/opengl/demos/android/NEWTGraphUI2pActivityLauncher.java
@@ -1,9 +1,10 @@
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import java.util.Arrays;
import java.util.List;
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+import com.jogamp.opengl.demos.android.LauncherUtil.BaseActivityLauncher;
+import com.jogamp.opengl.demos.android.LauncherUtil.OrderedProperties;
public class NEWTGraphUI2pActivityLauncher extends LauncherUtil.BaseActivityLauncher {
static String demo = "com.jogamp.opengl.test.android.NEWTGraphUI2pActivity";
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2Activity.java b/src/demos/com/jogamp/opengl/demos/android/NEWTRedSquareES2Activity.java
index db246c91c..1485fd3dd 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2Activity.java
+++ b/src/demos/com/jogamp/opengl/demos/android/NEWTRedSquareES2Activity.java
@@ -25,10 +25,11 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
+import com.jogamp.opengl.demos.es2.RedSquareES2;
import jogamp.newt.driver.android.NewtBaseActivity;
@@ -36,7 +37,6 @@ import com.jogamp.newt.event.MonitorEvent;
import com.jogamp.newt.event.MonitorModeListener;
import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.test.junit.jogl.demos.es2.RedSquareES2;
import com.jogamp.opengl.util.Animator;
import android.os.Bundle;
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2ActivityLauncher.java b/src/demos/com/jogamp/opengl/demos/android/NEWTRedSquareES2ActivityLauncher.java
index 22058dd34..061953d5e 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2ActivityLauncher.java
+++ b/src/demos/com/jogamp/opengl/demos/android/NEWTRedSquareES2ActivityLauncher.java
@@ -1,4 +1,4 @@
-package com.jogamp.opengl.test.android;
+package com.jogamp.opengl.demos.android;
import android.app.Activity;
import android.content.Intent;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/CrossFadePlayer.java b/src/demos/com/jogamp/opengl/demos/av/CrossFadePlayer.java
index cc4096672..a4d5e73de 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/CrossFadePlayer.java
+++ b/src/demos/com/jogamp/opengl/demos/av/CrossFadePlayer.java
@@ -26,7 +26,7 @@
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.jogl.demos.es2.av;
+package com.jogamp.opengl.demos.av;
import com.jogamp.common.net.Uri;
import com.jogamp.common.util.InterruptSource;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/demos/com/jogamp/opengl/demos/av/MovieCube.java
index c43d216dc..caf2f9381 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/demos/com/jogamp/opengl/demos/av/MovieCube.java
@@ -26,7 +26,7 @@
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.jogl.demos.es2.av;
+package com.jogamp.opengl.demos.av;
import java.io.File;
import java.io.IOException;
@@ -57,9 +57,9 @@ import com.jogamp.newt.event.WindowAdapter;
import com.jogamp.newt.event.WindowEvent;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.JoglVersion;
-import com.jogamp.opengl.test.junit.graph.TextRendererGLELBase;
-import com.jogamp.opengl.test.junit.jogl.demos.es2.TextureSequenceCubeES2;
-import com.jogamp.opengl.test.junit.util.MiscUtils;
+import com.jogamp.opengl.demos.es2.TextureSequenceCubeES2;
+import com.jogamp.opengl.demos.graph.TextRendererGLELBase;
+import com.jogamp.opengl.demos.util.MiscUtils;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.GLReadBufferUtil;
import com.jogamp.opengl.util.av.GLMediaPlayer;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSBSStereo.java b/src/demos/com/jogamp/opengl/demos/av/MovieSBSStereo.java
index d9028822e..62e3975dd 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSBSStereo.java
+++ b/src/demos/com/jogamp/opengl/demos/av/MovieSBSStereo.java
@@ -26,7 +26,7 @@
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.jogl.demos.es2.av;
+package com.jogamp.opengl.demos.av;
import java.net.URISyntaxException;
import java.nio.FloatBuffer;
@@ -60,11 +60,10 @@ import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.GLExtensions;
import com.jogamp.opengl.GLProfile;
import com.jogamp.opengl.JoglVersion;
+import com.jogamp.opengl.demos.graph.TextRendererGLELBase;
import com.jogamp.opengl.math.FloatUtil;
import com.jogamp.opengl.math.Quaternion;
import com.jogamp.opengl.math.VectorUtil;
-import com.jogamp.opengl.test.junit.graph.TextRendererGLELBase;
-import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.util.CustomGLEventListener;
import com.jogamp.opengl.util.GLArrayDataServer;
import com.jogamp.opengl.util.PMVMatrix;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java
index 2b2bcbcc4..42c7b94a5 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java
@@ -26,26 +26,14 @@
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.jogl.demos.es2.av;
+package com.jogamp.opengl.demos.av;
import java.io.File;
import java.io.IOException;
+import java.net.URI;
import java.net.URISyntaxException;
import java.nio.FloatBuffer;
-import com.jogamp.opengl.GL;
-import com.jogamp.opengl.GL2ES2;
-import com.jogamp.opengl.GLAnimatorControl;
-import com.jogamp.opengl.GLAutoDrawable;
-import com.jogamp.opengl.GLCapabilities;
-import com.jogamp.opengl.GLES2;
-import com.jogamp.opengl.GLEventListener;
-import com.jogamp.opengl.GLException;
-import com.jogamp.opengl.GLProfile;
-import com.jogamp.opengl.GLRunnable;
-import com.jogamp.opengl.GLUniformData;
-import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
-
import com.jogamp.common.net.Uri;
import com.jogamp.common.os.Platform;
import com.jogamp.common.util.InterruptSource;
@@ -65,10 +53,22 @@ import com.jogamp.newt.event.MouseListener;
import com.jogamp.newt.event.WindowAdapter;
import com.jogamp.newt.event.WindowEvent;
import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.GL;
+import com.jogamp.opengl.GL2ES2;
+import com.jogamp.opengl.GLAnimatorControl;
+import com.jogamp.opengl.GLAutoDrawable;
+import com.jogamp.opengl.GLCapabilities;
+import com.jogamp.opengl.GLES2;
+import com.jogamp.opengl.GLEventListener;
+import com.jogamp.opengl.GLException;
import com.jogamp.opengl.GLExtensions;
+import com.jogamp.opengl.GLProfile;
+import com.jogamp.opengl.GLRunnable;
+import com.jogamp.opengl.GLUniformData;
import com.jogamp.opengl.JoglVersion;
-import com.jogamp.opengl.test.junit.graph.TextRendererGLELBase;
-import com.jogamp.opengl.test.junit.util.MiscUtils;
+import com.jogamp.opengl.demos.graph.TextRendererGLELBase;
+import com.jogamp.opengl.demos.util.MiscUtils;
+import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.GLArrayDataServer;
import com.jogamp.opengl.util.GLReadBufferUtil;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/stereo/StereoDemo01.java b/src/demos/com/jogamp/opengl/demos/av/StereoDemo01.java
index 0d1f1700d..88a49a09a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/stereo/StereoDemo01.java
+++ b/src/demos/com/jogamp/opengl/demos/av/StereoDemo01.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.jogl.stereo;
+package com.jogamp.opengl.demos.av;
import java.io.File;
import java.net.URISyntaxException;
@@ -38,6 +38,9 @@ import com.jogamp.opengl.GLAutoDrawable;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
import com.jogamp.opengl.GLRunnable;
+import com.jogamp.opengl.demos.es2.GearsES2;
+import com.jogamp.opengl.demos.util.MiscUtils;
+import com.jogamp.opengl.demos.util.QuitAdapter;
import jogamp.opengl.util.stereo.GenericStereoDevice;
@@ -49,11 +52,6 @@ import com.jogamp.newt.event.KeyEvent;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.newt.opengl.util.stereo.StereoDeviceUtil;
import com.jogamp.opengl.math.FovHVHalves;
-import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
-import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSBSStereo;
-import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple;
-import com.jogamp.opengl.test.junit.util.MiscUtils;
-import com.jogamp.opengl.test.junit.util.QuitAdapter;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.AnimatorBase;
import com.jogamp.opengl.util.av.GLMediaPlayer;
@@ -331,6 +329,7 @@ public class StereoDemo01 {
window.addWindowListener(quitAdapter);
window.addKeyListener(new KeyAdapter() {
+ @Override
public void keyReleased(final KeyEvent e) {
if( e.isAutoRepeat() ) {
return;
diff --git a/src/demos/com/jogamp/opengl/demos/es2/GearsES2.java b/src/demos/com/jogamp/opengl/demos/es2/GearsES2.java
index ffb4f95d0..23cd8978d 100644
--- a/src/demos/com/jogamp/opengl/demos/es2/GearsES2.java
+++ b/src/demos/com/jogamp/opengl/demos/es2/GearsES2.java
@@ -32,6 +32,7 @@ import com.jogamp.newt.event.PinchToZoomGesture;
import com.jogamp.newt.event.GestureHandler.GestureEvent;
import com.jogamp.opengl.GLRendererQuirks;
import com.jogamp.opengl.JoglVersion;
+import com.jogamp.opengl.demos.GearsObject;
import com.jogamp.opengl.math.FloatUtil;
import com.jogamp.opengl.math.Quaternion;
import com.jogamp.opengl.math.VectorUtil;
@@ -55,8 +56,6 @@ import com.jogamp.opengl.GLAutoDrawable;
import com.jogamp.opengl.GLUniformData;
import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
-import com.jogamp.opengl.demos.GearsObject;
-
/**
* GearsES2.java <BR>
* @author Brian Paul (converted to Java by Ron Cemer and Sven Gothel) <P>
diff --git a/src/demos/com/jogamp/opengl/demos/es2/GearsObjectES2.java b/src/demos/com/jogamp/opengl/demos/es2/GearsObjectES2.java
index 5c48a5df1..3aa6696df 100644
--- a/src/demos/com/jogamp/opengl/demos/es2/GearsObjectES2.java
+++ b/src/demos/com/jogamp/opengl/demos/es2/GearsObjectES2.java
@@ -27,13 +27,11 @@ import com.jogamp.opengl.GL2ES2;
import com.jogamp.opengl.GLBufferStorage;
import com.jogamp.opengl.GLException;
import com.jogamp.opengl.GLUniformData;
-
+import com.jogamp.opengl.demos.GearsObject;
import com.jogamp.opengl.util.GLArrayDataServer;
import com.jogamp.opengl.util.PMVMatrix;
import com.jogamp.opengl.util.glsl.ShaderState;
-import com.jogamp.opengl.demos.GearsObject;
-
/**
* GearsObjectES2.java <BR>
* @author Brian Paul (converted to Java by Ron Cemer and Sven Gothel) <P>
diff --git a/src/demos/com/jogamp/opengl/demos/es2/TextureSequenceCubeES2.java b/src/demos/com/jogamp/opengl/demos/es2/TextureSequenceCubeES2.java
new file mode 100644
index 000000000..6a7115143
--- /dev/null
+++ b/src/demos/com/jogamp/opengl/demos/es2/TextureSequenceCubeES2.java
@@ -0,0 +1,491 @@
+/**
+ * Copyright 2012 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.
+ */
+package com.jogamp.opengl.demos.es2;
+
+import java.nio.FloatBuffer;
+
+import com.jogamp.opengl.GL;
+import com.jogamp.opengl.GL2ES2;
+import com.jogamp.opengl.GLAutoDrawable;
+import com.jogamp.opengl.GLES2;
+import com.jogamp.opengl.GLEventListener;
+import com.jogamp.opengl.GLException;
+import com.jogamp.opengl.GLProfile;
+import com.jogamp.opengl.GLUniformData;
+import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
+
+import com.jogamp.common.os.Platform;
+import com.jogamp.newt.Window;
+import com.jogamp.newt.event.MouseAdapter;
+import com.jogamp.newt.event.MouseEvent;
+import com.jogamp.newt.event.MouseListener;
+import com.jogamp.opengl.GLExtensions;
+import com.jogamp.opengl.JoglVersion;
+import com.jogamp.opengl.util.GLArrayDataServer;
+import com.jogamp.opengl.util.PMVMatrix;
+import com.jogamp.opengl.util.glsl.ShaderCode;
+import com.jogamp.opengl.util.glsl.ShaderProgram;
+import com.jogamp.opengl.util.glsl.ShaderState;
+import com.jogamp.opengl.util.texture.Texture;
+import com.jogamp.opengl.util.texture.TextureCoords;
+import com.jogamp.opengl.util.texture.TextureSequence;
+import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
+
+public class TextureSequenceCubeES2 implements GLEventListener {
+ public TextureSequenceCubeES2 (final TextureSequence texSource, final boolean innerCube, final float zoom0, final float rotx, final float roty) {
+ this.texSeq = texSource;
+ this.innerCube = innerCube;
+ this.zoom = zoom0;
+ this.view_rotx = rotx;
+ this.view_roty = roty;
+ }
+
+ private TextureSequence texSeq;
+ public ShaderState st;
+ public PMVMatrix pmvMatrix;
+ private GLUniformData pmvMatrixUniform;
+ // private TextureCoords[] textureCoords = null;
+ private float nearPlaneNormalized;
+ // private float zoom0=-5.0f, zoom=zoom0;
+ // private float view_rotx = 20.0f, view_roty = 30.0f, view_rotz = 0.0f;
+ public float zoom=-2.3f;
+ private float view_rotx = 0.0f, view_roty = 0.0f;
+ private final float view_rotz = 0.0f;
+ int[] vboNames = new int[4];
+ boolean innerCube;
+
+ private final MouseListener mouseAction = new MouseAdapter() {
+ int lx = 0;
+ int ly = 0;
+ boolean first = false;
+
+ public void mousePressed(final MouseEvent e) {
+ first = true;
+ }
+ public void mouseMoved(final MouseEvent e) {
+ first = false;
+ }
+ public void mouseDragged(final MouseEvent e) {
+ int width, height;
+ final Object source = e.getSource();
+ Window window = null;
+ if(source instanceof Window) {
+ window = (Window) source;
+ width=window.getSurfaceWidth();
+ height=window.getSurfaceHeight();
+ } else if (source instanceof GLAutoDrawable) {
+ final GLAutoDrawable glad = (GLAutoDrawable) source;
+ width = glad.getSurfaceWidth();
+ height = glad.getSurfaceHeight();
+ } else if (GLProfile.isAWTAvailable() && source instanceof java.awt.Component) {
+ final java.awt.Component comp = (java.awt.Component) source;
+ width=comp.getWidth(); // FIXME HiDPI: May need to convert window units -> pixel units!
+ height=comp.getHeight();
+ } else {
+ throw new RuntimeException("Event source neither Window nor Component: "+source);
+ }
+ if(e.getPointerCount()==2) {
+ // 2 pointers zoom ..
+ if(first) {
+ lx = Math.abs(e.getY(0)-e.getY(1));
+ first=false;
+ return;
+ }
+ final int nv = Math.abs(e.getY(0)-e.getY(1));
+ final int dy = nv - lx;
+
+ {
+ final float o = zoom;
+ final float d = 40f*Math.signum(dy)/height;
+ zoom += d;
+ System.err.println("zoom.d: "+o+" + "+d+" -> "+zoom);
+ }
+
+ lx = nv;
+ } else {
+ // 1 pointer rotate
+ if(first) {
+ lx = e.getX();
+ ly = e.getY();
+ first=false;
+ return;
+ }
+ final int nx = e.getX();
+ final int ny = e.getY();
+ view_roty += 360f * ( (float)( nx - lx ) / (float)width );
+ view_rotx += 360f * ( (float)( ny - ly ) / (float)height );
+ lx = nx;
+ ly = ny;
+ }
+ }
+ public void mouseWheelMoved(final MouseEvent e) {
+ // System.err.println("XXX "+e);
+ if( !e.isShiftDown() ) {
+ final float o = zoom;
+ final float d = e.getRotation()[1]/10f; // vertical: wheel
+ zoom += d;
+ System.err.println("zoom.w: "+o+" + "+d+" -> "+zoom);
+ }
+ }
+ };
+
+ static final String shaderBasename = "texsequence_xxx";
+ static final String myTextureLookupName = "myTexture2D";
+
+ private void initShader(final GL2ES2 gl) {
+ // Create & Compile the shader objects
+ final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
+ "shader", "shader/bin", shaderBasename, true);
+ final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(),
+ "shader", "shader/bin", shaderBasename, true);
+
+ boolean preludeGLSLVersion = true;
+ if( GLES2.GL_TEXTURE_EXTERNAL_OES == texSeq.getTextureTarget() ) {
+ if( !gl.isExtensionAvailable(GLExtensions.OES_EGL_image_external) ) {
+ throw new GLException(GLExtensions.OES_EGL_image_external+" requested but not available");
+ }
+ if( Platform.OSType.ANDROID == Platform.getOSType() && gl.isGLES3() ) {
+ // Bug on Nexus 10, ES3 - Android 4.3, where
+ // GL_OES_EGL_image_external extension directive leads to a failure _with_ '#version 300 es' !
+ // P0003: Extension 'GL_OES_EGL_image_external' not supported
+ preludeGLSLVersion = false;
+ }
+ }
+ rsVp.defaultShaderCustomization(gl, preludeGLSLVersion, true);
+
+ int rsFpPos = preludeGLSLVersion ? rsFp.addGLSLVersion(gl) : 0;
+ rsFpPos = rsFp.insertShaderSource(0, rsFpPos, texSeq.getRequiredExtensionsShaderStub());
+ rsFp.addDefaultShaderPrecision(gl, rsFpPos);
+
+ final String texLookupFuncName = texSeq.getTextureLookupFunctionName(myTextureLookupName);
+ rsFp.replaceInShaderSource(myTextureLookupName, texLookupFuncName);
+
+ // Inject TextureSequence shader details
+ final StringBuilder sFpIns = new StringBuilder();
+ sFpIns.append("uniform ").append(texSeq.getTextureSampler2DType()).append(" mgl_ActiveTexture;\n");
+ sFpIns.append(texSeq.getTextureLookupFragmentShaderImpl());
+ rsFp.insertShaderSource(0, "TEXTURE-SEQUENCE-CODE-BEGIN", 0, sFpIns);
+
+ // Create & Link the shader program
+ final ShaderProgram sp = new ShaderProgram();
+ sp.add(rsVp);
+ sp.add(rsFp);
+ if(!sp.link(gl, System.err)) {
+ throw new GLException("Couldn't link program: "+sp);
+ }
+
+ // Let's manage all our states using ShaderState.
+ st = new ShaderState();
+ st.attachShaderProgram(gl, sp, false);
+ }
+
+ GLArrayDataServer interleavedVBO, cubeIndicesVBO;
+
+ public void init(final GLAutoDrawable drawable) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+ System.err.println(JoglVersion.getGLInfo(gl, null));
+ final TextureFrame frame = texSeq.getLastTexture();
+ if( null == frame ) {
+ return;
+ }
+ final Texture tex= frame.getTexture();
+
+ initShader(gl);
+
+ // Push the 1st uniform down the path
+ st.useProgram(gl, true);
+
+ pmvMatrix = new PMVMatrix();
+ reshapePMV(drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
+ pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
+ if(!st.uniform(gl, pmvMatrixUniform)) {
+ throw new GLException("Error setting PMVMatrix in shader: "+st);
+ }
+ if(!st.uniform(gl, new GLUniformData("mgl_ActiveTexture", texSeq.getTextureUnit()))) {
+ throw new GLException("Error setting mgl_ActiveTexture in shader: "+st);
+ }
+
+
+ // calculate centered tex coords w/ aspect ratio
+ final float[] fixedCubeTexCoords = new float[s_cubeTexCoords.length];
+ {
+ final float aspect = tex.getAspectRatio();
+ final TextureCoords tc = tex.getImageTexCoords();
+ System.err.println("XXX0: aspect: "+aspect);
+ System.err.println("XXX0: y-flip: "+tex.getMustFlipVertically());
+ System.err.println("XXX0: "+tc);
+ final float tc_x1 = Math.max(tc.left(), tc.right());
+ final float tc_y1 = Math.max(tc.bottom(), tc.top());
+ final float ss=1f, ts=aspect; // scale tex-coord
+ final float dy = ( 1f - aspect ) / 2f ;
+ for(int i=0; i<s_cubeTexCoords.length; i+=2) {
+ final float tx = s_cubeTexCoords[i+0];
+ final float ty = s_cubeTexCoords[i+1];
+ if(tx!=0) {
+ fixedCubeTexCoords[i+0] = tc_x1 * ss;
+ }
+ if(ty==0 && !tex.getMustFlipVertically() || ty!=0 && tex.getMustFlipVertically()) {
+ fixedCubeTexCoords[i+1] = 0f + dy;
+ } else {
+ fixedCubeTexCoords[i+1] = tc_y1 * ts + dy;
+ }
+ }
+ }
+
+ interleavedVBO = GLArrayDataServer.createGLSLInterleaved(3+4+2, GL.GL_FLOAT, false, 3*6*4, GL.GL_STATIC_DRAW);
+ {
+ interleavedVBO.addGLSLSubArray("mgl_Vertex", 3, GL.GL_ARRAY_BUFFER);
+ interleavedVBO.addGLSLSubArray("mgl_Color", 4, GL.GL_ARRAY_BUFFER);
+ //interleavedVBO.addGLSLSubArray("mgl_Normal", 3, GL.GL_ARRAY_BUFFER);
+ interleavedVBO.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
+
+ final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
+
+ for(int i=0; i<6*4; i++) {
+ ib.put(s_cubeVertices, i*3, 3);
+ ib.put(s_cubeColors, i*4, 4);
+ //ib.put(s_cubeNormals, i*3, 3);
+ ib.put(fixedCubeTexCoords, i*2, 2);
+ }
+ }
+ interleavedVBO.seal(gl, true);
+ interleavedVBO.enableBuffer(gl, false);
+ st.ownAttribute(interleavedVBO, true);
+
+ cubeIndicesVBO = GLArrayDataServer.createData(6, GL.GL_UNSIGNED_SHORT, 6, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+ for(int i=0; i<6*6; i++) {
+ cubeIndicesVBO.puts(s_cubeIndices[i]);
+ }
+ cubeIndicesVBO.seal(gl, true);
+ cubeIndicesVBO.enableBuffer(gl, false);
+ st.ownAttribute(cubeIndicesVBO, true);
+
+
+ gl.glEnable(GL.GL_DEPTH_TEST);
+
+ st.useProgram(gl, false);
+
+ final Object upstreamWidget = drawable.getUpstreamWidget();
+ if (upstreamWidget instanceof Window) {
+ final Window window = (Window) upstreamWidget;
+ window.addMouseListener(mouseAction);
+ } else if (GLProfile.isAWTAvailable() && upstreamWidget instanceof java.awt.Component) {
+ final java.awt.Component comp = (java.awt.Component) upstreamWidget;
+ new com.jogamp.newt.event.awt.AWTMouseAdapter(mouseAction, drawable).addTo(comp);
+ }
+
+ // Let's show the completed shader state ..
+ System.out.println("iVBO: "+interleavedVBO);
+ System.out.println(st);
+ }
+
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+ gl.glViewport(0, 0, width, height);
+
+ if(!innerCube) {
+ // lights on
+ } else {
+ // lights off
+ }
+ // gl.glEnable(GL.GL_CULL_FACE);
+ // gl.glDisable(GL.GL_DITHER);
+
+ if(null != st) {
+ reshapePMV(width, height);
+ st.useProgram(gl, true);
+ st.uniform(gl, pmvMatrixUniform);
+ st.useProgram(gl, false);
+ }
+ }
+
+
+ private void reshapePMV(final int width, final int height) {
+ if(null != pmvMatrix) {
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
+ pmvMatrix.glLoadIdentity();
+ if(!innerCube) {
+ pmvMatrix.gluPerspective(45.0f, (float)width / (float)height, 1f, 10.0f);
+ nearPlaneNormalized = 1f/(100f-1f);
+ } else {
+ pmvMatrix.glOrthof(-1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 10.0f);
+ nearPlaneNormalized = 0f;
+ }
+ System.err.println("XXX0: Perspective nearPlaneNormalized: "+nearPlaneNormalized);
+
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+ pmvMatrix.glLoadIdentity();
+ pmvMatrix.glTranslatef(0, 0, zoom);
+ }
+ }
+
+
+ @Override
+ public void dispose(final GLAutoDrawable drawable) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+ texSeq = null;
+ pmvMatrixUniform = null;
+ pmvMatrix=null;
+ if( null != st ) {
+ st.destroy(gl);
+ st=null;
+ }
+ }
+
+ @Override
+ public void display(final GLAutoDrawable drawable) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+ if(innerCube) {
+ // Clear background to white
+ gl.glClearColor(1.0f, 1.0f, 1.0f, 0.4f);
+ } else {
+ // Clear background to blue
+ gl.glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
+ }
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+
+ if( null == st ) {
+ return;
+ }
+
+ st.useProgram(gl, true);
+
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+ pmvMatrix.glLoadIdentity();
+ pmvMatrix.glTranslatef(0, 0, zoom);
+ pmvMatrix.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f);
+ pmvMatrix.glRotatef(view_roty, 0.0f, 1.0f, 0.0f);
+ pmvMatrix.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f);
+ st.uniform(gl, pmvMatrixUniform);
+ interleavedVBO.enableBuffer(gl, true);
+ Texture tex = null;
+ if(null!=texSeq) {
+ final TextureSequence.TextureFrame texFrame = texSeq.getNextTexture(gl);
+ if(null != texFrame) {
+ tex = texFrame.getTexture();
+ gl.glActiveTexture(GL.GL_TEXTURE0+texSeq.getTextureUnit());
+ tex.enable(gl);
+ tex.bind(gl);
+ }
+ }
+ cubeIndicesVBO.bindBuffer(gl, true); // keeps VBO binding
+ gl.glDrawElements(GL.GL_TRIANGLES, cubeIndicesVBO.getElemCount() * cubeIndicesVBO.getCompsPerElem(), GL.GL_UNSIGNED_SHORT, 0);
+ cubeIndicesVBO.bindBuffer(gl, false);
+
+ if(null != tex) {
+ tex.disable(gl);
+ }
+ interleavedVBO.enableBuffer(gl, false);
+ st.useProgram(gl, false);
+ }
+
+ static final float[] light_position = { -50.f, 50.f, 50.f, 0.f };
+ static final float[] light_ambient = { 0.125f, 0.125f, 0.125f, 1.f };
+ static final float[] light_diffuse = { 1.0f, 1.0f, 1.0f, 1.f };
+ static final float[] material_spec = { 1.0f, 1.0f, 1.0f, 0.f };
+ static final float[] zero_vec4 = { 0.0f, 0.0f, 0.0f, 0.f };
+
+ private static final float[] s_cubeVertices = /* f b t b r l */
+ {
+ -1f, 1f, 1f, 1f, -1f, 1f, 1f, 1f, 1f, -1f, -1f, 1f,
+
+ -1f, 1f, -1f, 1f, -1f, -1f, 1f, 1f, -1f, -1f, -1f, -1f,
+
+ -1f, -1f, 1f, 1f, -1f, -1f, 1f, -1f, 1f, -1f, -1f, -1f,
+
+ -1f, 1f, 1f, 1f, 1f, -1f, 1f, 1f, 1f, -1f, 1f, -1f,
+
+ 1f, -1f, 1f, 1f, 1f, -1f, 1f, 1f, 1f, 1f, -1f, -1f,
+
+ -1f, -1f, 1f, -1f, 1f, -1f, -1f, 1f, 1f, -1f, -1f, -1f
+ };
+
+ private static final float[] s_cubeTexCoords =
+ { // LT RB RT LB
+ 0f, 1f, 1f, 0f, 1f, 1f, 0f, 0f,
+
+ 0f, 1f, 1f, 0f, 1f, 1f, 0f, 0f,
+
+ 0f, 1f, 1f, 0f, 1f, 1f, 0f, 0f,
+
+ 0f, 1f, 1f, 0f, 1f, 1f, 0f, 0f,
+
+ 0f, 0f, 1f, 1f, 0f, 1f, 1f, 0f,
+
+ 0f, 0f, 1f, 1f, 0f, 1f, 1f, 0f,
+ };
+
+ private static final float[] s_cubeColors =
+ {
+ 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f,
+
+ 40f/255f, 80f/255f, 160f/255f, 255f/255f, 40f/255f, 80f/255f, 160f/255f, 255f/255f,
+ 40f/255f, 80f/255f, 160f/255f, 255f/255f, 40f/255f, 80f/255f, 160f/255f, 255f/255f,
+
+ 40f/255f, 80f/255f, 160f/255f, 255f/255f, 40f/255f, 80f/255f, 160f/255f, 255f/255f,
+ 40f/255f, 80f/255f, 160f/255f, 255f/255f, 40f/255f, 80f/255f, 160f/255f, 255f/255f,
+
+ 128f/255f, 128f/255f, 128f/255f, 255f/255f, 128f/255f, 128f/255f, 128f/255f, 255f/255f,
+ 128f/255f, 128f/255f, 128f/255f, 255f/255f, 128f/255f, 128f/255f, 128f/255f, 255f/255f,
+
+ 255f/255f, 110f/255f, 10f/255f, 255f/255f, 255f/255f, 110f/255f, 10f/255f, 255f/255f,
+ 255f/255f, 110f/255f, 10f/255f, 255f/255f, 255f/255f, 110f/255f, 10f/255f, 255f/255f,
+
+ 255f/255f, 70f/255f, 60f/255f, 255f/255f, 255f/255f, 70f/255f, 60f/255f, 255f/255f,
+ 255f/255f, 70f/255f, 60f/255f, 255f/255f, 255f/255f, 70f/255f, 60f/255f, 255f/255f
+ };
+
+ /*
+ private static final float[] s_cubeNormals =
+ {
+ 0f, 0f, 1f, 0f, 0f, 1f, 0f, 0f, 1f, 0f, 0f, 1f,
+
+ 0f, 0f, -1f, 0f, 0f, -1f, 0f, 0f, -1f, 0f, 0f, -1f,
+
+ 0f, -1f, 0f, 0f, -1f, 0f, 0f, -1f, 0f, 0f, -1f, 0f,
+
+ 0f, 1f, 0f, 0f, 1f, 0f, 0f, 1f, 0f, 0f, 1f, 0f,
+
+ 1f, 0f, 0f, 1f, 0f, 0f, 1f, 0f, 0f, 1f, 0f, 0f,
+
+ -1f, 0f, 0f, -1f, 0f, 0f, -1f, 0f, 0f, -1f, 0f, 0f
+ };*/
+ private static final short[] s_cubeIndices =
+ {
+ 0, 3, 1, 2, 0, 1, /* front */
+ 6, 5, 4, 5, 7, 4, /* back */
+ 8, 11, 9, 10, 8, 9, /* top */
+ 15, 12, 13, 12, 14, 13, /* bottom */
+ 16, 19, 17, 18, 16, 17, /* right */
+ 23, 20, 21, 20, 22, 21 /* left */
+ };
+}
+
diff --git a/src/demos/com/jogamp/opengl/demos/graph/FontSetDemos.java b/src/demos/com/jogamp/opengl/demos/graph/FontSetDemos.java
new file mode 100644
index 000000000..12c996945
--- /dev/null
+++ b/src/demos/com/jogamp/opengl/demos/graph/FontSetDemos.java
@@ -0,0 +1,35 @@
+package com.jogamp.opengl.demos.graph;
+
+import java.io.IOException;
+
+import com.jogamp.common.util.IOUtil;
+import com.jogamp.graph.font.Font;
+import com.jogamp.graph.font.FontFactory;
+import com.jogamp.graph.font.FontSet;
+
+public class FontSetDemos {
+ public static Font[] getSet01() throws IOException {
+ final Font[] fonts = new Font[11];
+ int i = 0;
+ fonts[i++] = FontFactory.get(FontFactory.UBUNTU).getDefault(); // FontSet.FAMILY_REGULAR, FontSet.STYLE_NONE
+ fonts[i++] = FontFactory.get(FontFactory.UBUNTU).get(FontSet.FAMILY_LIGHT, FontSet.STYLE_NONE);
+ fonts[i++] = FontFactory.get(FontFactory.UBUNTU).get(FontSet.FAMILY_LIGHT, FontSet.STYLE_ITALIC);
+ fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeMono.ttf",
+ FontSetDemos.class.getClassLoader(), FontSetDemos.class).getInputStream(), true);
+ fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeMonoBold.ttf",
+ FontSetDemos.class.getClassLoader(), FontSetDemos.class).getInputStream(), true);
+ fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSans.ttf",
+ FontSetDemos.class.getClassLoader(), FontSetDemos.class).getInputStream(), true);
+ fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSansBold.ttf",
+ FontSetDemos.class.getClassLoader(), FontSetDemos.class).getInputStream(), true);
+ fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerif.ttf",
+ FontSetDemos.class.getClassLoader(), FontSetDemos.class).getInputStream(), true);
+ fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerifBold.ttf",
+ FontSetDemos.class.getClassLoader(), FontSetDemos.class).getInputStream(), true);
+ fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerifBoldItalic.ttf",
+ FontSetDemos.class.getClassLoader(), FontSetDemos.class).getInputStream(), true);
+ fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerifItalic.ttf",
+ FontSetDemos.class.getClassLoader(), FontSetDemos.class).getInputStream(), true);
+ return fonts;
+ }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener00.java b/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener00.java
index bc53bee2b..2515b8217 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener00.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener00.java
@@ -26,7 +26,7 @@
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.demos;
+package com.jogamp.opengl.demos.graph;
import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL2ES2;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java b/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener01.java
index 506c47f7d..c7fbe54c8 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener01.java
@@ -26,7 +26,7 @@
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.demos;
+package com.jogamp.opengl.demos.graph;
import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL2ES2;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener10.java b/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener10.java
index 188c27495..6af1aac96 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener10.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/GPURegionGLListener10.java
@@ -26,7 +26,7 @@
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.demos;
+package com.jogamp.opengl.demos.graph;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo.java b/src/demos/com/jogamp/opengl/demos/graph/GPURegionNewtDemo.java
index a5990af89..59292c7be 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/GPURegionNewtDemo.java
@@ -26,11 +26,11 @@
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.demos;
+package com.jogamp.opengl.demos.graph;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
-
+import com.jogamp.opengl.demos.util.MiscUtils;
import com.jogamp.graph.curve.Region;
import com.jogamp.graph.curve.opengl.RenderState;
import com.jogamp.graph.geom.SVertex;
@@ -39,7 +39,6 @@ import com.jogamp.newt.event.KeyEvent;
import com.jogamp.newt.event.WindowAdapter;
import com.jogamp.newt.event.WindowEvent;
import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.util.Animator;
/** Demonstrate the rendering of multiple outlines into one region/OutlineShape
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java b/src/demos/com/jogamp/opengl/demos/graph/GPURendererListenerBase01.java
index 1bce5e72c..185699d55 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/GPURendererListenerBase01.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.demos;
+package com.jogamp.opengl.demos.graph;
import java.io.File;
import java.io.IOException;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java b/src/demos/com/jogamp/opengl/demos/graph/GPUTextGLListener0A.java
index 9c6402a68..8a8a49869 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/GPUTextGLListener0A.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.demos;
+package com.jogamp.opengl.demos.graph;
import com.jogamp.opengl.GL;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo.java b/src/demos/com/jogamp/opengl/demos/graph/GPUTextNewtDemo.java
index 889f92a69..b4e91e01f 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/GPUTextNewtDemo.java
@@ -25,10 +25,11 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.demos;
+package com.jogamp.opengl.demos.graph;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
+import com.jogamp.opengl.demos.util.MiscUtils;
import com.jogamp.opengl.math.geom.AABBox;
import java.io.File;
@@ -47,7 +48,6 @@ import com.jogamp.newt.event.KeyEvent;
import com.jogamp.newt.event.WindowAdapter;
import com.jogamp.newt.event.WindowEvent;
import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.util.Animator;
public class GPUTextNewtDemo {
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java b/src/demos/com/jogamp/opengl/demos/graph/GPUTextRendererListenerBase01.java
index d18766ee1..f23548b8a 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/GPUTextRendererListenerBase01.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.demos;
+package com.jogamp.opengl.demos.graph;
import java.io.IOException;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/MSAATool.java b/src/demos/com/jogamp/opengl/demos/graph/MSAATool.java
index bd50da534..e0815b70a 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/MSAATool.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/MSAATool.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.demos;
+package com.jogamp.opengl.demos.graph;
import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL2ES2;
diff --git a/src/demos/com/jogamp/opengl/demos/graph/TextRendererGLELBase.java b/src/demos/com/jogamp/opengl/demos/graph/TextRendererGLELBase.java
new file mode 100644
index 000000000..61240e4a2
--- /dev/null
+++ b/src/demos/com/jogamp/opengl/demos/graph/TextRendererGLELBase.java
@@ -0,0 +1,291 @@
+/**
+ * Copyright 2014 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.
+ */
+package com.jogamp.opengl.demos.graph;
+
+import java.io.IOException;
+
+import com.jogamp.opengl.GL2ES2;
+import com.jogamp.opengl.GLAutoDrawable;
+import com.jogamp.opengl.GLEventListener;
+import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
+
+import com.jogamp.graph.curve.opengl.GLRegion;
+import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.curve.opengl.TextRegionUtil;
+import com.jogamp.graph.font.Font;
+import com.jogamp.graph.font.FontFactory;
+import com.jogamp.graph.font.FontScale;
+import com.jogamp.graph.font.FontSet;
+import com.jogamp.graph.geom.SVertex;
+import com.jogamp.graph.geom.plane.AffineTransform;
+import com.jogamp.newt.Window;
+import com.jogamp.opengl.util.PMVMatrix;
+
+public abstract class TextRendererGLELBase implements GLEventListener {
+ public final int renderModes;
+
+ protected final int[] vbaaSampleCount;
+ protected final float[] staticRGBAColor = new float[] { 1f, 1f, 1f, 1f };
+
+ private boolean exclusivePMVMatrix = true;
+ private PMVMatrix sharedPMVMatrix = null;
+ private RenderState rs = null;
+ private RegionRenderer.GLCallback enableCallback=null, disableCallback=null;
+ protected RegionRenderer renderer = null;
+ protected TextRegionUtil textRenderUtil = null;
+
+ protected final AffineTransform tempT1 = new AffineTransform();
+ protected final AffineTransform tempT2 = new AffineTransform();
+
+ /** scale pixel, default is 1f */
+ protected float pixelScale = 1.0f;
+
+ /** dpi display resolution, queried at {@link #init(GLAutoDrawable)} if NEWT, otherwise 96. */
+ protected float dpiH = 96;
+
+ boolean flipVerticalInGLOrientation = false;
+
+ /**
+ * @param fontSet e.g. default is {@link FontFactory#UBUNTU}
+ * @param fontFamily e.g. default is {@link FontSet#FAMILY_REGULAR}
+ * @param fontStylebits e.g. default is {@link FontSet#STYLE_NONE}
+ * @return the resulting font.
+ */
+ public static Font getFont(final int fontSet, final int fontFamily, final int fontStylebits) {
+ try {
+ return FontFactory.get(fontSet).get(fontFamily, fontStylebits);
+ } catch (final IOException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ /**
+ * @param renderModes
+ * @param sampleCount desired multisampling sample count for msaa-rendering.
+ * @see #setRendererCallbacks(com.jogamp.graph.curve.opengl.RegionRenderer.GLCallback, com.jogamp.graph.curve.opengl.RegionRenderer.GLCallback)
+ */
+ public TextRendererGLELBase(final int renderModes, final int[] sampleCount) {
+ this.renderModes = renderModes;
+ this.vbaaSampleCount = sampleCount;
+ }
+
+ /**
+ * <p>
+ * Must be called before {@link #init(GLAutoDrawable)}.
+ * </p>
+ * @param rs
+ */
+ public void setRenderState(final RenderState rs) { this.rs = rs; }
+
+ /**
+ * In exclusive mode, impl. uses a pixelScale of 1f and orthogonal PMV on window dimensions
+ * and renderString uses 'height' for '1'.
+ * <p>
+ * In non-exclusive mode, i.e. shared w/ custom PMV (within another 3d scene),
+ * it uses the custom pixelScale and renderString uses normalized 'height', i.e. '1'.
+ * </p>
+ * <p>
+ * Must be called before {@link #init(GLAutoDrawable)}.
+ * </p>
+ */
+ public void setSharedPMVMatrix(final PMVMatrix pmv) {
+ this.sharedPMVMatrix = pmv;
+ }
+
+ /**
+ * See {@link RegionRenderer#create(RenderState, com.jogamp.graph.curve.opengl.RegionRenderer.GLCallback, com.jogamp.graph.curve.opengl.RegionRenderer.GLCallback)}.
+ * <p>
+ * Must be called before {@link #init(GLAutoDrawable)}.
+ * </p>
+ */
+ public void setRendererCallbacks(final RegionRenderer.GLCallback enable, final RegionRenderer.GLCallback disable) {
+ this.enableCallback = enable;
+ this.disableCallback = disable;
+ }
+
+ public void setFlipVerticalInGLOrientation(final boolean v) { flipVerticalInGLOrientation=v; }
+ public final RegionRenderer getRenderer() { return renderer; }
+ public final TextRegionUtil getTextRenderUtil() { return textRenderUtil; }
+
+ @Override
+ public void init(final GLAutoDrawable drawable) {
+ if( null == this.rs ) {
+ exclusivePMVMatrix = null == sharedPMVMatrix;
+ this.rs = RenderState.createRenderState(SVertex.factory(), sharedPMVMatrix);
+ }
+ this.renderer = RegionRenderer.create(rs, enableCallback, disableCallback);
+ rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);
+ this.textRenderUtil = new TextRegionUtil(renderModes);
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+ renderer.init(gl);
+ rs.setColorStatic(staticRGBAColor[0], staticRGBAColor[1], staticRGBAColor[2], staticRGBAColor[3]);
+ renderer.enable(gl, false);
+
+ final Object upObj = drawable.getUpstreamWidget();
+ if( upObj instanceof Window ) {
+ final float[] dpi = FontScale.perMMToPerInch( ((Window)upObj).getPixelsPerMM(new float[2]) );
+ dpiH = dpi[1];
+ }
+ }
+
+ @Override
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+ if( null != renderer ) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+ renderer.enable(gl, true);
+ if( exclusivePMVMatrix ) {
+ // renderer.reshapePerspective(gl, 45.0f, width, height, 0.1f, 1000.0f);
+ renderer.reshapeOrtho(width, height, 0.1f, 1000.0f);
+ pixelScale = 1.0f;
+ } else {
+ renderer.reshapeNotify(width, height);
+ }
+ renderer.enable(gl, false);
+ }
+ }
+
+ @Override
+ public abstract void display(GLAutoDrawable drawable);
+
+ @Override
+ public void dispose(final GLAutoDrawable drawable) {
+ if( null != renderer ) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+ renderer.destroy(gl);
+ }
+ }
+
+ int lastRow = -1;
+
+ /**
+ *
+ * @param drawable
+ * @param font
+ * @param pixelSize Use {@link Font#toPixels(float, float)} for resolution correct pixel-size.
+ * @param text
+ * @param column
+ * @param tx
+ * @param ty
+ * @param tz
+ * @param cacheRegion
+ */
+ public void renderString(final GLAutoDrawable drawable,
+ final Font font, final float pixelSize, final String text,
+ final int column, final float tx, final float ty, final float tz, final boolean cacheRegion) {
+ final int row = lastRow + 1;
+ renderStringImpl(drawable, font, pixelSize, text, column, row, tx, ty, tz, cacheRegion, null);
+ }
+
+ public void renderString(final GLAutoDrawable drawable,
+ final Font font, final float pixelSize, final String text,
+ final int column, final float tx, final float ty, final float tz, final GLRegion region) {
+ final int row = lastRow + 1;
+ renderStringImpl(drawable, font, pixelSize, text, column, row, tx, ty, tz, false, region);
+ }
+
+ /**
+ *
+ * @param drawable
+ * @param font
+ * @param pixelSize Use {@link Font#toPixels(float, float)} for resolution correct pixel-size.
+ * @param text
+ * @param column
+ * @param row
+ * @param tx
+ * @param ty
+ * @param tz
+ * @param cacheRegion
+ */
+ public void renderString(final GLAutoDrawable drawable,
+ final Font font, final float pixelSize, final String text,
+ final int column, final int row,
+ final float tx, final float ty, final float tz, final boolean cacheRegion) {
+ renderStringImpl(drawable, font, pixelSize, text, column, row, tx, ty, tz, cacheRegion, null);
+ }
+
+ public void renderString(final GLAutoDrawable drawable,
+ final Font font, final float pixelSize, final String text,
+ final int column, final int row,
+ final float tx, final float ty, final float tz, final GLRegion region) {
+ renderStringImpl(drawable, font, pixelSize, text, column, row, tx, ty, tz, false, region);
+ }
+
+ private void renderStringImpl(final GLAutoDrawable drawable,
+ final Font font, final float pixelSize, final String text,
+ final int column, final int row,
+ final float tx, final float ty, final float tz, final boolean cacheRegion, final GLRegion region) {
+ if( null != renderer ) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+ float dx = tx;
+ float dy;
+
+ if( !exclusivePMVMatrix ) {
+ dy = 1f-ty;
+ } else {
+ final int height = drawable.getSurfaceHeight();
+ dy = height-ty;
+ }
+ final float sxy = pixelScale * pixelSize;
+ final int newLineCount = TextRegionUtil.getCharCount(text, '\n');
+ final float lineHeight = font.getLineHeight();
+ dx += sxy * font.getAdvanceWidth('X') * column;
+ dy -= sxy * lineHeight * ( row + 1 );
+
+ final PMVMatrix pmvMatrix = rs.getMatrix();
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+ if( !exclusivePMVMatrix ) {
+ pmvMatrix.glPushMatrix();
+ } else {
+ pmvMatrix.glLoadIdentity();
+ }
+ pmvMatrix.glTranslatef(dx, dy, tz);
+ if( flipVerticalInGLOrientation && drawable.isGLOriented() ) {
+ pmvMatrix.glScalef(sxy, -1f*sxy, 1.0f);
+ } else {
+ pmvMatrix.glScalef(sxy, sxy, 1.0f);
+ }
+ renderer.enable(gl, true);
+ if( cacheRegion ) {
+ textRenderUtil.drawString3D(gl, renderer, font, text, null, vbaaSampleCount);
+ } else if( null != region ) {
+ TextRegionUtil.drawString3D(gl, region, renderer, font, text, null, vbaaSampleCount, tempT1, tempT1);
+ } else {
+ TextRegionUtil.drawString3D(gl, renderModes, renderer, font, text, null, vbaaSampleCount, tempT1, tempT1);
+ }
+ renderer.enable(gl, false);
+
+ if( !exclusivePMVMatrix ) {
+ pmvMatrix.glPopMatrix();
+ }
+ lastRow = row + newLineCount;
+ }
+ }
+}
diff --git a/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeMono.ttf b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeMono.ttf
new file mode 100644
index 000000000..c4200565a
--- /dev/null
+++ b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeMono.ttf
Binary files differ
diff --git a/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeMonoBold.ttf b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeMonoBold.ttf
new file mode 100644
index 000000000..0bee057ec
--- /dev/null
+++ b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeMonoBold.ttf
Binary files differ
diff --git a/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeMonoBoldOblique.ttf b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeMonoBoldOblique.ttf
new file mode 100644
index 000000000..91bbc0e8a
--- /dev/null
+++ b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeMonoBoldOblique.ttf
Binary files differ
diff --git a/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeMonoOblique.ttf b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeMonoOblique.ttf
new file mode 100644
index 000000000..3252bdda6
--- /dev/null
+++ b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeMonoOblique.ttf
Binary files differ
diff --git a/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSans.ttf b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSans.ttf
new file mode 100644
index 000000000..e56dc6e90
--- /dev/null
+++ b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSans.ttf
Binary files differ
diff --git a/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSansBold.ttf b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSansBold.ttf
new file mode 100644
index 000000000..66e19ecb0
--- /dev/null
+++ b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSansBold.ttf
Binary files differ
diff --git a/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSansBoldOblique.ttf b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSansBoldOblique.ttf
new file mode 100644
index 000000000..de8a9e153
--- /dev/null
+++ b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSansBoldOblique.ttf
Binary files differ
diff --git a/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSansOblique.ttf b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSansOblique.ttf
new file mode 100644
index 000000000..b0357eabb
--- /dev/null
+++ b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSansOblique.ttf
Binary files differ
diff --git a/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSerif.ttf b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSerif.ttf
new file mode 100644
index 000000000..dffa1aedb
--- /dev/null
+++ b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSerif.ttf
Binary files differ
diff --git a/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSerifBold.ttf b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSerifBold.ttf
new file mode 100644
index 000000000..e2393ad22
--- /dev/null
+++ b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSerifBold.ttf
Binary files differ
diff --git a/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSerifBoldItalic.ttf b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSerifBoldItalic.ttf
new file mode 100644
index 000000000..46bc4695f
--- /dev/null
+++ b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSerifBoldItalic.ttf
Binary files differ
diff --git a/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSerifItalic.ttf b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSerifItalic.ttf
new file mode 100644
index 000000000..d173e3566
--- /dev/null
+++ b/src/demos/com/jogamp/opengl/demos/graph/fonts/freefont/FreeSerifItalic.ttf
Binary files differ
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/GPUUISceneGLListener0A.java b/src/demos/com/jogamp/opengl/demos/graph/ui/GPUUISceneGLListener0A.java
index f49258832..990143de8 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/GPUUISceneGLListener0A.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/GPUUISceneGLListener0A.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.ui.demos;
+package com.jogamp.opengl.demos.graph.ui;
import java.io.File;
import java.io.IOException;
@@ -43,6 +43,9 @@ import com.jogamp.opengl.GLEventListener;
import com.jogamp.opengl.GLPipelineFactory;
import com.jogamp.opengl.GLRunnable;
import com.jogamp.opengl.JoglVersion;
+import com.jogamp.opengl.demos.es2.GearsES2;
+import com.jogamp.opengl.demos.graph.FontSetDemos;
+import com.jogamp.opengl.demos.graph.MSAATool;
import com.jogamp.common.net.Uri;
import com.jogamp.common.util.IOUtil;
import com.jogamp.common.util.InterruptSource;
@@ -71,9 +74,6 @@ import com.jogamp.newt.event.MouseEvent.PointerClass;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.math.FloatUtil;
import com.jogamp.opengl.math.VectorUtil;
-import com.jogamp.opengl.test.junit.graph.FontSet01;
-import com.jogamp.opengl.test.junit.graph.demos.MSAATool;
-import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
import com.jogamp.opengl.util.GLReadBufferUtil;
import com.jogamp.opengl.util.av.GLMediaPlayer;
import com.jogamp.opengl.util.av.GLMediaPlayerFactory;
@@ -81,6 +81,7 @@ import com.jogamp.opengl.util.texture.ImageSequence;
import com.jogamp.opengl.util.texture.TextureIO;
public class GPUUISceneGLListener0A implements GLEventListener {
+ static private final String defaultMediaURL = "http://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4";
private boolean debug = false;
private boolean trace = false;
@@ -93,6 +94,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
private final Font font;
private final Font fontFPS;
+ private final Uri filmURL;
private final float sceneDist = 3000f;
private final float zNear = 0.1f, zFar = 7000f;
@@ -155,28 +157,30 @@ public class GPUUISceneGLListener0A implements GLEventListener {
* @param renderModes
*/
public GPUUISceneGLListener0A(final int renderModes) {
- this(null, renderModes, false, false);
+ this(null, null, renderModes, false, false);
}
/**
+ * @param filmURL TODO
* @param renderModes
* @param debug
* @param trace
*/
- public GPUUISceneGLListener0A(final String fontfilename, final int renderModes, final boolean debug, final boolean trace) {
- this(fontfilename, 0f, renderModes, debug, trace);
+ public GPUUISceneGLListener0A(final String fontfilename, final String filmURL, final int renderModes, final boolean debug, final boolean trace) {
+ this(fontfilename, filmURL, 0f, renderModes, debug, trace);
}
/**
+ * @param filmURL TODO
* @param noAADPIThreshold see {@link #DefaultNoAADPIThreshold}
* @param debug
* @param trace
*/
- public GPUUISceneGLListener0A(final String fontfilename, final float noAADPIThreshold, final boolean debug, final boolean trace) {
- this(fontfilename, noAADPIThreshold, 0, debug, trace);
+ public GPUUISceneGLListener0A(final String fontfilename, final String filmURL, final float noAADPIThreshold, final boolean debug, final boolean trace) {
+ this(fontfilename, filmURL, noAADPIThreshold, 0, debug, trace);
}
- private GPUUISceneGLListener0A(final String fontfilename, final float noAADPIThreshold, final int renderModes, final boolean debug, final boolean trace) {
+ private GPUUISceneGLListener0A(final String fontfilename, final String filmURL, final float noAADPIThreshold, final int renderModes, final boolean debug, final boolean trace) {
this.noAADPIThreshold = noAADPIThreshold;
this.debug = debug;
this.trace = trace;
@@ -186,19 +190,24 @@ public class GPUUISceneGLListener0A implements GLEventListener {
try {
if( null == fontfilename ) {
font = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerif.ttf",
- FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true);
+ FontSetDemos.class.getClassLoader(), FontSetDemos.class).getInputStream(), true);
} else {
font = FontFactory.get( new File( fontfilename ) );
}
System.err.println("Font "+font.getFullFamilyName());
fontFPS = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeMonoBold.ttf",
- FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true);
+ FontSetDemos.class.getClassLoader(), FontSetDemos.class).getInputStream(), true);
System.err.println("Font FPS "+fontFPS.getFullFamilyName());
} catch (final IOException ioe) {
throw new RuntimeException(ioe);
}
+ try {
+ this.filmURL = Uri.cast( null != filmURL ? filmURL : defaultMediaURL );
+ } catch (final URISyntaxException e1) {
+ throw new RuntimeException(e1);
+ }
{
final RenderState rs = RenderState.createRenderState(SVertex.factory());
final RegionRenderer renderer = RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable);
@@ -219,7 +228,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
}
private void translateButtons(final float tx, final float ty, final float tz) {
for(int i=0; i<buttons.size(); i++) {
- buttons.get(i).translate(tx, ty, tz);
+ buttons.get(i).move(tx, ty, tz);
}
}
@@ -280,7 +289,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
Button button = new Button(SVertex.factory(), renderModes, font, "Next Text", buttonXSize, buttonYSize);
button.setName(BUTTON_NEXTTEXT);
- button.translate(xStartLeft,yStartTop-diffY*buttons.size(), 0f);
+ button.move(xStartLeft,yStartTop-diffY*buttons.size(), 0f);
button.addMouseListener(new Shape.MouseGestureAdapter() {
@Override
public void mouseClicked(final MouseEvent e) {
@@ -297,7 +306,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
button = new Button(SVertex.factory(), renderModes, font, "Show FPS", buttonXSize, buttonYSize);
button.setName(BUTTON_FPS);
- button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
+ button.move(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
button.setToggleable(true);
button.setToggle(fpsLabel.isEnabled());
button.addMouseListener(new Shape.MouseGestureAdapter() {
@@ -314,7 +323,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
button = new Button(SVertex.factory(), renderModes, font, "V-Sync", buttonXSize, buttonYSize);
button.setName(BUTTON_VSYNC);
- button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
+ button.move(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
button.setToggleable(true);
button.setToggle(gl.getSwapInterval()>0);
button.addMouseListener(new Shape.MouseGestureAdapter() {
@@ -337,11 +346,11 @@ public class GPUUISceneGLListener0A implements GLEventListener {
buttons.add(button);
button = new Button(SVertex.factory(), renderModes, font, "< Tilt >", buttonXSize, buttonYSize);
- button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
+ button.move(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
button.addMouseListener(new Shape.MouseGestureAdapter() {
@Override
public void mouseClicked(final MouseEvent e) {
- final Shape.UIShapeEvent shapeEvent = (Shape.UIShapeEvent) e.getAttachment();
+ final Shape.EventInfo shapeEvent = (Shape.EventInfo) e.getAttachment();
if( shapeEvent.objPos[0] < shapeEvent.shape.getBounds().getCenter()[0] ) {
rotateButtons(new float[] { 0f, -5f, 0f}); // left-half pressed
} else {
@@ -356,11 +365,11 @@ public class GPUUISceneGLListener0A implements GLEventListener {
if( pass2Mode ) { // second column to the left
button = new Button(SVertex.factory(), renderModes, font, "< Samples >", buttonXSize, buttonYSize);
- button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
+ button.move(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
button.addMouseListener(new Shape.MouseGestureAdapter() {
@Override
public void mouseClicked(final MouseEvent e) {
- final Shape.UIShapeEvent shapeEvent = (Shape.UIShapeEvent) e.getAttachment();
+ final Shape.EventInfo shapeEvent = (Shape.EventInfo) e.getAttachment();
int sampleCount = sceneUICntrl.getSampleCount();
if( shapeEvent.objPos[0] < shapeEvent.shape.getBounds().getCenter()[0] ) {
// left-half pressed
@@ -375,11 +384,11 @@ public class GPUUISceneGLListener0A implements GLEventListener {
buttons.add(button);
button = new Button(SVertex.factory(), renderModes, font, "< Quality >", buttonXSize, buttonYSize);
- button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
+ button.move(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
button.addMouseListener(new Shape.MouseGestureAdapter() {
@Override
public void mouseClicked(final MouseEvent e) {
- final Shape.UIShapeEvent shapeEvent = (Shape.UIShapeEvent) e.getAttachment();
+ final Shape.EventInfo shapeEvent = (Shape.EventInfo) e.getAttachment();
int quality = shapeEvent.shape.getQuality();
if( shapeEvent.objPos[0] < shapeEvent.shape.getBounds().getCenter()[0] ) {
@@ -401,7 +410,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
button = new Button(SVertex.factory(), renderModes, font, "Quit", buttonXSize, buttonYSize);
button.setName(BUTTON_QUIT);
- button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
+ button.move(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
button.setColor(0.7f, 0.0f, 0.0f, 1.0f);
button.setLabelColor(1.2f, 1.2f, 1.2f);
button.setPressedColorMod(1.1f, 0.0f, 0.0f, 1.0f);
@@ -428,7 +437,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
final int j = 1; // column
int k = 0; // row
button = new Button(SVertex.factory(), renderModes, font, "Y Flip", buttonXSize, buttonYSize);
- button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
+ button.move(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
button.addMouseListener(new Shape.MouseGestureAdapter() {
@Override
public void mouseClicked(final MouseEvent e) {
@@ -439,7 +448,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
k++;
button = new Button(SVertex.factory(), renderModes, font, "X Flip", buttonXSize, buttonYSize);
- button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
+ button.move(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
button.addMouseListener(new Shape.MouseGestureAdapter() {
@Override
public void mouseClicked(final MouseEvent e) {
@@ -450,11 +459,11 @@ public class GPUUISceneGLListener0A implements GLEventListener {
k++;
button = new Button(SVertex.factory(), renderModes, font, "+", buttonXSize, buttonYSize);
- button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
+ button.move(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
button.addMouseListener(new Shape.MouseGestureAdapter() {
@Override
public void mouseClicked(final MouseEvent e) {
- final Shape.UIShapeEvent shapeEvent = (Shape.UIShapeEvent) e.getAttachment();
+ final Shape.EventInfo shapeEvent = (Shape.EventInfo) e.getAttachment();
// rel position to center
final float dx = shapeEvent.objPos[0] - shapeEvent.shape.getBounds().getCenter()[0] ;
final float dy = shapeEvent.objPos[1] - shapeEvent.shape.getBounds().getCenter()[1] ;
@@ -474,11 +483,11 @@ public class GPUUISceneGLListener0A implements GLEventListener {
k++;
button = new Button(SVertex.factory(), renderModes, font, "< Space >", buttonXSize, buttonYSize);
- button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
+ button.move(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
button.addMouseListener(new Shape.MouseGestureAdapter() {
@Override
public void mouseClicked(final MouseEvent e) {
- final Shape.UIShapeEvent shapeEvent = (Shape.UIShapeEvent) e.getAttachment();
+ final Shape.EventInfo shapeEvent = (Shape.EventInfo) e.getAttachment();
final float dx, dy;
if( shapeEvent.objPos[0] < shapeEvent.shape.getBounds().getCenter()[0] ) {
dx=-0.01f; dy=-0.005f;
@@ -495,11 +504,11 @@ public class GPUUISceneGLListener0A implements GLEventListener {
k++;
button = new Button(SVertex.factory(), renderModes, font, "< Corner >", buttonXSize, buttonYSize);
- button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
+ button.move(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
button.addMouseListener(new Shape.MouseGestureAdapter() {
@Override
public void mouseClicked(final MouseEvent e) {
- final Shape.UIShapeEvent shapeEvent = (Shape.UIShapeEvent) e.getAttachment();
+ final Shape.EventInfo shapeEvent = (Shape.EventInfo) e.getAttachment();
final float dc;
if( shapeEvent.objPos[0] < shapeEvent.shape.getBounds().getCenter()[0] ) {
dc=-0.1f;
@@ -516,7 +525,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
k++;
button = new Button(SVertex.factory(), renderModes, font, "Reset", buttonXSize, buttonYSize);
- button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
+ button.move(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
button.addMouseListener(new Shape.MouseGestureAdapter() {
@Override
public void mouseClicked(final MouseEvent e) {
@@ -527,7 +536,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
k++;
button = new Button(SVertex.factory(), renderModes, font, "Snapshot", buttonXSize, buttonYSize);
- button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
+ button.move(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
button.addMouseListener(new Shape.MouseGestureAdapter() {
@Override
public void mouseClicked(final MouseEvent e) {
@@ -565,7 +574,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
mPlayerButton.setName(BUTTON_MOVIE);
mPlayerButton.setVerbose(true);
mPlayerButton.addDefaultEventListener();
- mPlayerButton.translate(xStartRight, yStartTop - diffY*1, 0f);
+ mPlayerButton.move(xStartRight, yStartTop - diffY*1, 0f);
mPlayerButton.setToggleable(true);
mPlayerButton.setToggle(false); // toggle == false -> mute audio
mPlayerButton.setToggleOffColorMod(0f, 1f, 0f, 1.0f);
@@ -576,12 +585,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
mPlayer.setAudioVolume( mPlayerButton.isToggleOn() ? 1f : 0f );
} } );
buttons.add(mPlayerButton);
- try {
- final Uri streamLoc = Uri.cast("http://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4");
- mPlayer.initStream(streamLoc, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.TEXTURE_COUNT_DEFAULT);
- } catch (final URISyntaxException e1) {
- e1.printStackTrace();
- }
+ mPlayer.initStream(filmURL, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.TEXTURE_COUNT_DEFAULT);
}
if( true ) {
final ImageSequence imgSeq = new ImageSequence(texUnitImageButton, true);
@@ -594,7 +598,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
e2.printStackTrace();
}
imgSeq.setManualStepping(true);
- imgButton.translate(xStartRight, yStartTop - diffY*2.5f, 0f);
+ imgButton.move(xStartRight, yStartTop - diffY*2.5f, 0f);
imgButton.addMouseListener(dragZoomRotateListener);
imgButton.addMouseListener(new Shape.MouseGestureAdapter() {
@Override
@@ -626,7 +630,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
glelButton.setToggleable(true);
glelButton.setToggle(false); // toggle == true -> animation
glelButton.setAnimate(false);
- glelButton.translate(xStartRight, yStartTop - diffY*4f, 0f);
+ glelButton.move(xStartRight, yStartTop - diffY*4f, 0f);
glelButton.addMouseListener(dragZoomRotateListener);
glelButton.addMouseListener(new Shape.MouseGestureAdapter() {
@Override
@@ -686,7 +690,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
truePtSizeLabel = new Label(sceneUICntrl.getVertexFactory(), renderModes, font, pixelSize10Pt, truePtSize);
sceneUICntrl.addShape(truePtSizeLabel);
truePtSizeLabel.setEnabled(enableOthers);
- truePtSizeLabel.translate(0, - 1.5f * jogampLabel.getLineHeight(), 0f);
+ truePtSizeLabel.move(0, - 1.5f * jogampLabel.getLineHeight(), 0f);
truePtSizeLabel.setColor(0.1f, 0.1f, 0.1f, 1.0f);
/**
@@ -700,7 +704,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
sceneUICntrl.addShape(fpsLabel);
fpsLabel.setEnabled(enableOthers);
fpsLabel.setColor(0.1f, 0.1f, 0.1f, 1.0f);
- fpsLabel.translate(0f, pixelSizeFPS * (fontFPS.getMetrics().getLineGap() - fontFPS.getMetrics().getDescent()), 0f);
+ fpsLabel.move(0f, pixelSizeFPS * (fontFPS.getMetrics().getLineGap() - fontFPS.getMetrics().getDescent()), 0f);
initButtons(drawable.getGL().getGL2ES2(), drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
for(int i=0; i<buttons.size(); i++) {
@@ -822,24 +826,24 @@ public class GPUUISceneGLListener0A implements GLEventListener {
reshapeUI(drawable);
}
for(int i=0; i<buttons.size() && i<buttonsLeftCount; i++) {
- buttons.get(i).translate(dxLeft, dyTop, dz);
+ buttons.get(i).move(dxLeft, dyTop, dz);
}
for(int i=buttonsLeftCount; i<buttons.size(); i++) {
- buttons.get(i).translate(dxRight, dyTop, dz);
+ buttons.get(i).move(dxRight, dyTop, dz);
}
final float dxMiddleAbs = width * relMiddle;
final float dyTopLabelAbs = drawable.getSurfaceHeight() - 2f*jogampLabel.getLineHeight();
- jogampLabel.setTranslate(dxMiddleAbs, dyTopLabelAbs, dz);
- truePtSizeLabel.setTranslate(dxMiddleAbs, dyTopLabelAbs, dz);
- truePtSizeLabel.setTranslate(dxMiddleAbs, dyTopLabelAbs - 1.5f * jogampLabel.getLineHeight(), 0f);
- fpsLabel.translate(0f, 0f, 0f);
+ jogampLabel.setPosition(dxMiddleAbs, dyTopLabelAbs, dz);
+ truePtSizeLabel.setPosition(dxMiddleAbs, dyTopLabelAbs, dz);
+ truePtSizeLabel.setPosition(dxMiddleAbs, dyTopLabelAbs - 1.5f * jogampLabel.getLineHeight(), 0f);
+ fpsLabel.move(0f, 0f, 0f);
if( null != labels[currentText] ) {
- labels[currentText].setTranslate(dxMiddleAbs,
+ labels[currentText].setPosition(dxMiddleAbs,
dyTopLabelAbs - 1.5f * jogampLabel.getLineHeight()
- 1.5f * truePtSizeLabel.getLineHeight(), 0f);
System.err.println("Label["+currentText+"] MOVE: "+labels[currentText]);
- System.err.println("Label["+currentText+"] MOVE: "+Arrays.toString(labels[currentText].getTranslate()));
+ System.err.println("Label["+currentText+"] MOVE: "+Arrays.toString(labels[currentText].getPosition()));
}
sceneUICntrl.reshape(drawable, x, y, width, height);
@@ -885,13 +889,13 @@ public class GPUUISceneGLListener0A implements GLEventListener {
labels[currentText] = new Label(sceneUICntrl.getVertexFactory(), renderModes, font, pixelSizeFixed, strings[currentText]);
labels[currentText].setColor(0.1f, 0.1f, 0.1f, 1.0f);
labels[currentText].setEnabled(enableOthers);
- labels[currentText].translate(dxMiddle,
+ labels[currentText].move(dxMiddle,
dyTop - 1.5f * jogampLabel.getLineHeight()
- 1.5f * truePtSizeLabel.getLineHeight(), 0f);
labels[currentText].addMouseListener(dragZoomRotateListener);
sceneUICntrl.addShape(labels[currentText]);
System.err.println("Label["+currentText+"] CTOR: "+labels[currentText]);
- System.err.println("Label["+currentText+"] CTOR: "+Arrays.toString(labels[currentText].getTranslate()));
+ System.err.println("Label["+currentText+"] CTOR: "+Arrays.toString(labels[currentText].getPosition()));
}
if( fpsLabel.isEnabled() ) {
final String text;
@@ -929,22 +933,22 @@ public class GPUUISceneGLListener0A implements GLEventListener {
@Override
public void mouseDragged(final MouseEvent e) {
- final Shape.UIShapeEvent shapeEvent = (Shape.UIShapeEvent) e.getAttachment();
+ final Shape.EventInfo shapeEvent = (Shape.EventInfo) e.getAttachment();
if( e.getPointerCount() == 1 ) {
- final float[] tx = shapeEvent.shape.getTranslate();
+ final float[] tx = shapeEvent.shape.getPosition();
actionText = String.format((Locale)null, "Pos %6.2f / %6.2f / %6.2f", tx[0], tx[1], tx[2]);
}
}
@Override
public void mouseWheelMoved(final MouseEvent e) {
- final Shape.UIShapeEvent shapeEvent = (Shape.UIShapeEvent) e.getAttachment();
+ final Shape.EventInfo shapeEvent = (Shape.EventInfo) e.getAttachment();
final boolean isOnscreen = PointerClass.Onscreen == e.getPointerType(0).getPointerClass();
if( 0 == ( ~InputEvent.BUTTONALL_MASK & e.getModifiers() ) && !isOnscreen ) {
// offscreen vertical mouse wheel zoom
final float tz = 100f*e.getRotation()[1]; // vertical: wheel
System.err.println("Rotate.Zoom.W: "+tz);
- shapeEvent.shape.translate(0f, 0f, tz);
+ shapeEvent.shape.move(0f, 0f, tz);
} else if( isOnscreen || e.isControlDown() ) {
final float[] rot = VectorUtil.scaleVec3(e.getRotation(), e.getRotation(), FloatUtil.PI / 180.0f);
if( isOnscreen ) {
@@ -958,12 +962,12 @@ public class GPUUISceneGLListener0A implements GLEventListener {
}
@Override
public void gestureDetected(final GestureEvent e) {
- final Shape.UIShapeEvent shapeEvent = (Shape.UIShapeEvent) e.getAttachment();
+ final Shape.EventInfo shapeEvent = (Shape.EventInfo) e.getAttachment();
if( e instanceof PinchToZoomGesture.ZoomEvent ) {
final PinchToZoomGesture.ZoomEvent ze = (PinchToZoomGesture.ZoomEvent) e;
final float tz = ze.getDelta() * ze.getScale();
System.err.println("Rotate.Zoom.G: "+tz);
- shapeEvent.shape.translate(0f, 0f, tz);
+ shapeEvent.shape.move(0f, 0f, tz);
}
} };
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/GPUUISceneNewtDemo.java b/src/demos/com/jogamp/opengl/demos/graph/ui/GPUUISceneNewtDemo.java
index 36e8ee713..4ab5326d5 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/GPUUISceneNewtDemo.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/GPUUISceneNewtDemo.java
@@ -25,12 +25,13 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.ui.demos;
+package com.jogamp.opengl.demos.graph.ui;
import com.jogamp.nativewindow.ScalableSurface;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
import com.jogamp.opengl.JoglVersion;
+import com.jogamp.opengl.demos.util.MiscUtils;
import com.jogamp.common.util.VersionUtil;
import com.jogamp.graph.curve.Region;
import com.jogamp.newt.Display;
@@ -39,7 +40,6 @@ import com.jogamp.newt.Screen;
import com.jogamp.newt.event.WindowAdapter;
import com.jogamp.newt.event.WindowEvent;
import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.caps.NonFSAAGLCapsChooser;
@@ -62,6 +62,7 @@ public class GPUUISceneNewtDemo {
final float[] reqSurfacePixelScale = new float[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
String fontfilename = null;
+ String filmURL = null;
int width = 1280, height = 720;
@@ -113,6 +114,9 @@ public class GPUUISceneNewtDemo {
forceGL3 = true;
} else if(args[i].equals("-gldef")) {
forceGLDef = true;
+ } else if(args[i].equals("-film")) {
+ i++;
+ filmURL = args[i];
}
}
}
@@ -170,8 +174,8 @@ public class GPUUISceneNewtDemo {
window.setSurfaceScale(reqSurfacePixelScale);
// final float[] valReqSurfacePixelScale = window.getRequestedSurfaceScale(new float[2]);
- final GPUUISceneGLListener0A scene = 0 < GraphAutoMode ? new GPUUISceneGLListener0A(fontfilename, GraphAutoMode, DEBUG, TRACE) :
- new GPUUISceneGLListener0A(fontfilename, rmode, DEBUG, TRACE);
+ final GPUUISceneGLListener0A scene = 0 < GraphAutoMode ? new GPUUISceneGLListener0A(fontfilename, filmURL, GraphAutoMode, DEBUG, TRACE) :
+ new GPUUISceneGLListener0A(fontfilename, filmURL, rmode, DEBUG, TRACE);
window.addGLEventListener(scene);
scene.attachInputListenerTo(window);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/GPUUISceneTextAnim01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/GPUUISceneTextAnim01.java
index 49757e7a0..45bfd53f1 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/GPUUISceneTextAnim01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/GPUUISceneTextAnim01.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.ui.demos;
+package com.jogamp.opengl.demos.graph.ui;
import java.io.File;
import java.io.IOException;
@@ -58,10 +58,10 @@ import com.jogamp.opengl.GLAutoDrawable;
import com.jogamp.opengl.GLEventListener;
import com.jogamp.opengl.GLPipelineFactory;
import com.jogamp.opengl.JoglVersion;
+import com.jogamp.opengl.demos.graph.FontSetDemos;
+import com.jogamp.opengl.demos.graph.MSAATool;
import com.jogamp.opengl.math.FloatUtil;
import com.jogamp.opengl.math.VectorUtil;
-import com.jogamp.opengl.test.junit.graph.FontSet01;
-import com.jogamp.opengl.test.junit.graph.demos.MSAATool;
import com.jogamp.opengl.util.GLReadBufferUtil;
public class GPUUISceneTextAnim01 implements GLEventListener {
@@ -121,14 +121,14 @@ public class GPUUISceneTextAnim01 implements GLEventListener {
try {
if( null == fontfilename ) {
font = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerif.ttf",
- FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true);
+ FontSetDemos.class.getClassLoader(), FontSetDemos.class).getInputStream(), true);
} else {
font = FontFactory.get( new File( fontfilename ) );
}
System.err.println("Font "+font.getFullFamilyName());
fontFPS = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeMonoBold.ttf",
- FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true);
+ FontSetDemos.class.getClassLoader(), FontSetDemos.class).getInputStream(), true);
System.err.println("Font FPS "+fontFPS.getFullFamilyName());
} catch (final IOException ioe) {
@@ -168,7 +168,7 @@ public class GPUUISceneTextAnim01 implements GLEventListener {
sceneUICntrl.addShape(fpsLabel);
fpsLabel.setEnabled(true);
fpsLabel.setColor(0.1f, 0.1f, 0.1f, 1.0f);
- fpsLabel.translate(0f, pixelSizeFPS * (fontFPS.getMetrics().getLineGap() - fontFPS.getMetrics().getDescent()), 0f);
+ fpsLabel.move(0f, pixelSizeFPS * (fontFPS.getMetrics().getLineGap() - fontFPS.getMetrics().getDescent()), 0f);
}
@Override
@@ -238,8 +238,8 @@ public class GPUUISceneTextAnim01 implements GLEventListener {
final float dxMiddleAbs = width * relMiddle;
final float dyTopLabelAbs = drawable.getSurfaceHeight() - 2f*jogampLabel.getLineHeight();
- jogampLabel.setTranslate(dxMiddleAbs, dyTopLabelAbs, dz);
- fpsLabel.translate(0f, 0f, 0f);
+ jogampLabel.setPosition(dxMiddleAbs, dyTopLabelAbs, dz);
+ fpsLabel.move(0f, 0f, 0f);
sceneUICntrl.reshape(drawable, x, y, width, height);
@@ -311,22 +311,22 @@ public class GPUUISceneTextAnim01 implements GLEventListener {
@Override
public void mouseDragged(final MouseEvent e) {
- final Shape.UIShapeEvent shapeEvent = (Shape.UIShapeEvent) e.getAttachment();
+ final Shape.EventInfo shapeEvent = (Shape.EventInfo) e.getAttachment();
if( e.getPointerCount() == 1 ) {
- final float[] tx = shapeEvent.shape.getTranslate();
+ final float[] tx = shapeEvent.shape.getPosition();
actionText = String.format((Locale)null, "Pos %6.2f / %6.2f / %6.2f", tx[0], tx[1], tx[2]);
}
}
@Override
public void mouseWheelMoved(final MouseEvent e) {
- final Shape.UIShapeEvent shapeEvent = (Shape.UIShapeEvent) e.getAttachment();
+ final Shape.EventInfo shapeEvent = (Shape.EventInfo) e.getAttachment();
final boolean isOnscreen = PointerClass.Onscreen == e.getPointerType(0).getPointerClass();
if( 0 == ( ~InputEvent.BUTTONALL_MASK & e.getModifiers() ) && !isOnscreen ) {
// offscreen vertical mouse wheel zoom
final float tz = 100f*e.getRotation()[1]; // vertical: wheel
System.err.println("Rotate.Zoom.W: "+tz);
- shapeEvent.shape.translate(0f, 0f, tz);
+ shapeEvent.shape.move(0f, 0f, tz);
} else if( isOnscreen || e.isControlDown() ) {
final float[] rot = VectorUtil.scaleVec3(e.getRotation(), e.getRotation(), FloatUtil.PI / 180.0f);
if( isOnscreen ) {
@@ -340,12 +340,12 @@ public class GPUUISceneTextAnim01 implements GLEventListener {
}
@Override
public void gestureDetected(final GestureEvent e) {
- final Shape.UIShapeEvent shapeEvent = (Shape.UIShapeEvent) e.getAttachment();
+ final Shape.EventInfo shapeEvent = (Shape.EventInfo) e.getAttachment();
if( e instanceof PinchToZoomGesture.ZoomEvent ) {
final PinchToZoomGesture.ZoomEvent ze = (PinchToZoomGesture.ZoomEvent) e;
final float tz = ze.getDelta() * ze.getScale();
System.err.println("Rotate.Zoom.G: "+tz);
- shapeEvent.shape.translate(0f, 0f, tz);
+ shapeEvent.shape.move(0f, 0f, tz);
}
} };
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/UIShapeDemo01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UIShapeDemo01.java
index 7ccd80f46..b89b3e2b9 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/UIShapeDemo01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UIShapeDemo01.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.ui.demos;
+package com.jogamp.opengl.demos.graph.ui;
import java.io.File;
import java.io.IOException;
@@ -41,10 +41,10 @@ import com.jogamp.opengl.GLException;
import com.jogamp.opengl.GLPipelineFactory;
import com.jogamp.opengl.GLProfile;
import com.jogamp.opengl.GLRunnable;
+import com.jogamp.opengl.demos.graph.MSAATool;
import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.opengl.math.FloatUtil;
import com.jogamp.opengl.math.geom.AABBox;
-import com.jogamp.opengl.test.junit.graph.demos.MSAATool;
import com.jogamp.common.util.InterruptSource;
import com.jogamp.graph.curve.Region;
import com.jogamp.graph.curve.opengl.RegionRenderer;
@@ -426,7 +426,7 @@ public class UIShapeDemo01 implements GLEventListener {
// final float dz = winObjPos[2] - objPosT[2];
if( !FloatUtil.isZero(dx, FloatUtil.EPSILON) || !FloatUtil.isZero(dy, FloatUtil.EPSILON) ) {
System.err.println("CrossHair: Move.1: Win "+glWinX+"/"+glWinY+" -> Obj "+winObjPos[0]+"/"+winObjPos[1]+"/"+winObjPos[1]+" -> diff "+dx+" / "+dy);
- crossHair.translate(dx, dy, 0f);
+ crossHair.move(dx, dy, 0f);
} else {
System.err.println("CrossHair: Move.0: Win "+glWinX+"/"+glWinY+" -> Obj "+winObjPos[0]+"/"+winObjPos[1]+"/"+winObjPos[1]+" -> diff "+dx+" / "+dy);
}
@@ -475,22 +475,22 @@ public class UIShapeDemo01 implements GLEventListener {
}
if(arg0.getKeyCode() == KeyEvent.VK_1){
- button.translate(0f, 0f, -zTran/10f);
+ button.move(0f, 0f, -zTran/10f);
}
else if(arg0.getKeyCode() == KeyEvent.VK_2){
- button.translate(0f, 0f, zTran/10f);
+ button.move(0f, 0f, zTran/10f);
}
else if(arg0.getKeyCode() == KeyEvent.VK_UP){
- button.translate(0f, button.getHeight()/10f, 0f);
+ button.move(0f, button.getHeight()/10f, 0f);
}
else if(arg0.getKeyCode() == KeyEvent.VK_DOWN){
- button.translate(0f, -button.getHeight()/10f, 0f);
+ button.move(0f, -button.getHeight()/10f, 0f);
}
else if(arg0.getKeyCode() == KeyEvent.VK_LEFT){
- button.translate(-button.getWidth()/10f, 0f, 0f);
+ button.move(-button.getWidth()/10f, 0f, 0f);
}
else if(arg0.getKeyCode() == KeyEvent.VK_RIGHT){
- button.translate(button.getWidth()/10f, 0f, 0f);
+ button.move(button.getWidth()/10f, 0f, 0f);
}
else if(arg0.getKeyCode() == KeyEvent.VK_4){
button.setSpacing(button.getSpacingX()-0.01f, button.getSpacingY()-0.005f);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/UITypeDemo01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UITypeDemo01.java
index b2a1bc772..56962e110 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/UITypeDemo01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UITypeDemo01.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.ui.demos;
+package com.jogamp.opengl.demos.graph.ui;
import java.io.File;
import java.io.IOException;
@@ -41,14 +41,14 @@ import com.jogamp.opengl.GLException;
import com.jogamp.opengl.GLPipelineFactory;
import com.jogamp.opengl.GLProfile;
import com.jogamp.opengl.GLRunnable;
+import com.jogamp.opengl.demos.graph.MSAATool;
+import com.jogamp.opengl.demos.graph.ui.testshapes.Glyph03FreeMonoRegular_M;
+import com.jogamp.opengl.demos.graph.ui.testshapes.Glyph04FreeSans_0;
+import com.jogamp.opengl.demos.graph.ui.testshapes.Glyph05FreeSerifBoldItalic_ae;
+import com.jogamp.opengl.demos.util.MiscUtils;
import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.opengl.math.FloatUtil;
import com.jogamp.opengl.math.geom.AABBox;
-import com.jogamp.opengl.test.junit.graph.demos.MSAATool;
-import com.jogamp.opengl.test.junit.graph.ui.testshapes.Glyph03FreeMonoRegular_M;
-import com.jogamp.opengl.test.junit.graph.ui.testshapes.Glyph04FreeSans_0;
-import com.jogamp.opengl.test.junit.graph.ui.testshapes.Glyph05FreeSerifBoldItalic_ae;
-import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.common.util.InterruptSource;
import com.jogamp.graph.curve.Region;
import com.jogamp.graph.curve.opengl.GLRegion;
@@ -207,7 +207,7 @@ public class UITypeDemo01 implements GLEventListener {
if (false ) {
final Rectangle o = new Rectangle(SVertex.factory(), renderModes, 1/10f, 1/20f, 1/1000f);
- o.translate(o.getWidth(), -o.getHeight(), 0f);
+ o.move(o.getWidth(), -o.getHeight(), 0f);
testObj = o;
} else {
final float scale = 0.15312886f;
@@ -492,7 +492,7 @@ public class UITypeDemo01 implements GLEventListener {
// final float dz = winObjPos[2] - objPosT[2];
if( !FloatUtil.isZero(dx, FloatUtil.EPSILON) || !FloatUtil.isZero(dy, FloatUtil.EPSILON) ) {
System.err.println("CrossHair: Move.1: Win "+glWinX+"/"+glWinY+" -> Obj "+winObjPos[0]+"/"+winObjPos[1]+"/"+winObjPos[1]+" -> diff "+dx+" / "+dy);
- crossHair.translate(dx, dy, 0f);
+ crossHair.move(dx, dy, 0f);
} else {
System.err.println("CrossHair: Move.0: Win "+glWinX+"/"+glWinY+" -> Obj "+winObjPos[0]+"/"+winObjPos[1]+"/"+winObjPos[1]+" -> diff "+dx+" / "+dy);
}
@@ -541,22 +541,22 @@ public class UITypeDemo01 implements GLEventListener {
}
if(arg0.getKeyCode() == KeyEvent.VK_1){
- crossHair.translate(0f, 0f, -zTran/10f);
+ crossHair.move(0f, 0f, -zTran/10f);
}
else if(arg0.getKeyCode() == KeyEvent.VK_2){
- crossHair.translate(0f, 0f, zTran/10f);
+ crossHair.move(0f, 0f, zTran/10f);
}
else if(arg0.getKeyCode() == KeyEvent.VK_UP){
- crossHair.translate(0f, crossHair.getHeight()/10f, 0f);
+ crossHair.move(0f, crossHair.getHeight()/10f, 0f);
}
else if(arg0.getKeyCode() == KeyEvent.VK_DOWN){
- crossHair.translate(0f, -crossHair.getHeight()/10f, 0f);
+ crossHair.move(0f, -crossHair.getHeight()/10f, 0f);
}
else if(arg0.getKeyCode() == KeyEvent.VK_LEFT){
- crossHair.translate(-crossHair.getWidth()/10f, 0f, 0f);
+ crossHair.move(-crossHair.getWidth()/10f, 0f, 0f);
}
else if(arg0.getKeyCode() == KeyEvent.VK_RIGHT){
- crossHair.translate(crossHair.getWidth()/10f, 0f, 0f);
+ crossHair.move(crossHair.getWidth()/10f, 0f, 0f);
}
else if(arg0.getKeyCode() == KeyEvent.VK_0){
// rotate(1);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/button-pressed-145x53.png b/src/demos/com/jogamp/opengl/demos/graph/ui/button-pressed-145x53.png
index 1eba3a09e..1eba3a09e 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/button-pressed-145x53.png
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/button-pressed-145x53.png
Binary files differ
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/button-released-145x53.png b/src/demos/com/jogamp/opengl/demos/graph/ui/button-released-145x53.png
index fe223c6d3..fe223c6d3 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/button-released-145x53.png
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/button-released-145x53.png
Binary files differ
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/ui/testshapes/Glyph01UbuntuLight_o.java b/src/demos/com/jogamp/opengl/demos/graph/ui/testshapes/Glyph01UbuntuLight_o.java
index a79a68d4e..4171eeda8 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/ui/testshapes/Glyph01UbuntuLight_o.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/testshapes/Glyph01UbuntuLight_o.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.ui.testshapes;
+package com.jogamp.opengl.demos.graph.ui.testshapes;
import com.jogamp.opengl.GL2ES2;
import com.jogamp.graph.curve.OutlineShape;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/ui/testshapes/Glyph02UbuntuLight_ae.java b/src/demos/com/jogamp/opengl/demos/graph/ui/testshapes/Glyph02UbuntuLight_ae.java
index b81eb546f..28d6f6390 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/ui/testshapes/Glyph02UbuntuLight_ae.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/testshapes/Glyph02UbuntuLight_ae.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.ui.testshapes;
+package com.jogamp.opengl.demos.graph.ui.testshapes;
import com.jogamp.opengl.GL2ES2;
import com.jogamp.graph.curve.OutlineShape;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/ui/testshapes/Glyph03FreeMonoRegular_M.java b/src/demos/com/jogamp/opengl/demos/graph/ui/testshapes/Glyph03FreeMonoRegular_M.java
index 053134866..45868762c 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/ui/testshapes/Glyph03FreeMonoRegular_M.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/testshapes/Glyph03FreeMonoRegular_M.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.ui.testshapes;
+package com.jogamp.opengl.demos.graph.ui.testshapes;
import com.jogamp.opengl.GL2ES2;
import com.jogamp.graph.curve.OutlineShape;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/ui/testshapes/Glyph04FreeSans_0.java b/src/demos/com/jogamp/opengl/demos/graph/ui/testshapes/Glyph04FreeSans_0.java
index 1f8d87888..63bc0b5b5 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/ui/testshapes/Glyph04FreeSans_0.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/testshapes/Glyph04FreeSans_0.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.ui.testshapes;
+package com.jogamp.opengl.demos.graph.ui.testshapes;
import com.jogamp.opengl.GL2ES2;
import com.jogamp.graph.curve.OutlineShape;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/ui/testshapes/Glyph05FreeSerifBoldItalic_ae.java b/src/demos/com/jogamp/opengl/demos/graph/ui/testshapes/Glyph05FreeSerifBoldItalic_ae.java
index c02ca56bc..dd92228ff 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/ui/testshapes/Glyph05FreeSerifBoldItalic_ae.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/testshapes/Glyph05FreeSerifBoldItalic_ae.java
@@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.test.junit.graph.ui.testshapes;
+package com.jogamp.opengl.demos.graph.ui.testshapes;
import com.jogamp.opengl.GL2ES2;
import com.jogamp.graph.curve.OutlineShape;
diff --git a/src/demos/com/jogamp/opengl/demos/MiscUtils.java b/src/demos/com/jogamp/opengl/demos/util/MiscUtils.java
index 304e4f18a..f1c367e95 100644
--- a/src/demos/com/jogamp/opengl/demos/MiscUtils.java
+++ b/src/demos/com/jogamp/opengl/demos/util/MiscUtils.java
@@ -27,7 +27,7 @@
*/
-package com.jogamp.opengl.demos;
+package com.jogamp.opengl.demos.util;
import java.io.BufferedReader;
import java.io.IOException;
diff --git a/src/demos/com/jogamp/opengl/demos/util/QuitAdapter.java b/src/demos/com/jogamp/opengl/demos/util/QuitAdapter.java
new file mode 100644
index 000000000..b7c3a6c22
--- /dev/null
+++ b/src/demos/com/jogamp/opengl/demos/util/QuitAdapter.java
@@ -0,0 +1,64 @@
+/**
+ * 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.
+ */
+
+package com.jogamp.opengl.demos.util;
+
+import com.jogamp.newt.event.*;
+
+public class QuitAdapter extends WindowAdapter implements WindowListener, KeyListener {
+ boolean shouldQuit = false;
+ boolean enabled = true;
+
+ public void enable(final boolean v) { enabled = v; }
+
+ public void clear() { shouldQuit = false; }
+
+ public boolean shouldQuit() { return shouldQuit; }
+ public void doQuit() { shouldQuit=true; }
+
+ public void windowDestroyNotify(final WindowEvent e) {
+ if( enabled ) {
+ System.err.println("QUIT Window "+Thread.currentThread());
+ shouldQuit = true;
+ }
+ }
+
+ public void keyReleased(final KeyEvent e) {
+ if( !e.isPrintableKey() || e.isAutoRepeat() ) {
+ return;
+ }
+ if( enabled ) {
+ if(e.getKeyChar()=='q') {
+ System.err.println("QUIT Key "+Thread.currentThread());
+ shouldQuit = true;
+ }
+ }
+ }
+ public void keyPressed(final KeyEvent e) {}
+}
+
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTElektronActivity.java b/src/test/com/jogamp/opengl/test/android/NEWTElektronActivity.java
deleted file mode 100644
index ebce37994..000000000
--- a/src/test/com/jogamp/opengl/test/android/NEWTElektronActivity.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * Copyright 2011 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.
- */
-package com.jogamp.opengl.test.android;
-
-import com.jogamp.opengl.GLCapabilities;
-import com.jogamp.opengl.GLProfile;
-
-import jogamp.newt.driver.android.NewtBaseActivity;
-
-import com.jogamp.newt.event.MonitorEvent;
-import com.jogamp.newt.event.MonitorModeListener;
-import com.jogamp.newt.opengl.GLWindow;
-
-import com.jogamp.opengl.test.junit.jogl.demos.es2.ElektronenMultiplizierer;
-import com.jogamp.opengl.util.Animator;
-
-import android.os.Bundle;
-import android.util.Log;
-
-public class NEWTElektronActivity extends NewtBaseActivity {
- static String TAG = "NEWTElektronActivity";
-
- @Override
- public void onCreate(final Bundle savedInstanceState) {
- Log.d(TAG, "onCreate - 0");
- super.onCreate(savedInstanceState);
-
- // create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
- final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
- Log.d(TAG, "req caps: "+caps);
- final GLWindow glWindow = GLWindow.create(caps);
- glWindow.setFullscreen(true);
- setContentView(getWindow(), glWindow);
-
- glWindow.addGLEventListener(new ElektronenMultiplizierer());
- glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
- @Override
- public void monitorModeChangeNotify(final MonitorEvent me) { }
- @Override
- public void monitorModeChanged(final MonitorEvent me, final boolean success) {
- System.err.println("MonitorMode Changed (success "+success+"): "+me);
- }
- });
- glWindow.setVisible(true);
- final Animator animator = new Animator(glWindow);
-
- animator.setUpdateFPSFrames(60, System.err);
- animator.resetFPSCounter();
- glWindow.resetFPSCounter();
-
- Log.d(TAG, "onCreate - X");
- }
-}
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTElektronActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTElektronActivityLauncher.java
deleted file mode 100644
index f2eb70bb6..000000000
--- a/src/test/com/jogamp/opengl/test/android/NEWTElektronActivityLauncher.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.jogamp.opengl.test.android;
-
-import java.util.Arrays;
-import java.util.List;
-
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
-
-public class NEWTElektronActivityLauncher extends LauncherUtil.BaseActivityLauncher {
-
- static String demo = "com.jogamp.opengl.test.android.NEWTElektronActivity";
- static String[] sys_pkgs = new String[] { "com.jogamp.common", "com.jogamp.opengl" };
- static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-
- @Override
- public void init() {
- final OrderedProperties props = getProperties();
- // props.setProperty("jogamp.debug.JNILibLoader", "true");
- // props.setProperty("jogamp.debug.NativeLibrary", "true");
- // properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
- // properties.setProperty("jogamp.debug.IOUtil", "true");
- // properties.setProperty("nativewindow.debug", "all");
- props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
- // properties.setProperty("jogl.debug", "all");
- // properties.setProperty("jogl.debug.GLProfile", "true");
- props.setProperty("jogl.debug.GLDrawable", "true");
- props.setProperty("jogl.debug.GLContext", "true");
- props.setProperty("jogl.debug.GLSLCode", "true");
- props.setProperty("jogl.debug.CapabilitiesChooser", "true");
- // properties.setProperty("jogl.debug.GLSLState", "true");
- // properties.setProperty("jogl.debug.DebugGL", "true");
- // properties.setProperty("jogl.debug.TraceGL", "true");
- // properties.setProperty("newt.debug", "all");
- props.setProperty("newt.debug.Window", "true");
- // properties.setProperty("newt.debug.Window.MouseEvent", "true");
- // properties.setProperty("newt.debug.Window.KeyEvent", "true");
- }
-
- @Override
- public String getActivityName() {
- return demo;
- }
- @Override
- public List<String> getSysPackages() {
- return Arrays.asList(sys_pkgs);
- }
-
- @Override
- public List<String> getUsrPackages() {
- return Arrays.asList(usr_pkgs);
- }
-}
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES1Activity.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES1Activity.java
deleted file mode 100644
index 46165e70b..000000000
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES1Activity.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * Copyright 2011 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.
- */
-package com.jogamp.opengl.test.android;
-
-import com.jogamp.opengl.GLCapabilities;
-import com.jogamp.opengl.GLProfile;
-
-import jogamp.newt.driver.android.NewtBaseActivity;
-
-import com.jogamp.newt.event.MonitorEvent;
-import com.jogamp.newt.event.MonitorModeListener;
-import com.jogamp.newt.opengl.GLWindow;
-
-import com.jogamp.opengl.test.junit.jogl.demos.es1.GearsES1;
-import com.jogamp.opengl.util.Animator;
-
-import android.os.Bundle;
-import android.util.Log;
-
-public class NEWTGearsES1Activity extends NewtBaseActivity {
- static String TAG = "NEWTGearsES1Activity";
-
- @Override
- public void onCreate(final Bundle savedInstanceState) {
- Log.d(TAG, "onCreate - 0");
- super.onCreate(savedInstanceState);
-
- // create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
- final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
- /*
- caps.setRedBits(5);
- caps.setGreenBits(6);
- caps.setBlueBits(5);
- caps.setAlphaBits(0); */
- Log.d(TAG, "req caps: "+caps);
- final GLWindow glWindow = GLWindow.create(caps);
- glWindow.setFullscreen(true);
- setContentView(getWindow(), glWindow);
-
- glWindow.addGLEventListener(new GearsES1(-1));
- glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
- @Override
- public void monitorModeChangeNotify(final MonitorEvent me) { }
- @Override
- public void monitorModeChanged(final MonitorEvent me, final boolean success) {
- System.err.println("MonitorMode Changed (success "+success+"): "+me);
- }
- });
- glWindow.setVisible(true);
- final Animator animator = new Animator(glWindow);
-
- animator.setUpdateFPSFrames(60, System.err);
- animator.resetFPSCounter();
- glWindow.resetFPSCounter();
-
- Log.d(TAG, "onCreate - X");
- }
-}
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES1ActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES1ActivityLauncher.java
deleted file mode 100644
index 5e721f32d..000000000
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES1ActivityLauncher.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.jogamp.opengl.test.android;
-
-import java.util.Arrays;
-import java.util.List;
-
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
-
-public class NEWTGearsES1ActivityLauncher extends LauncherUtil.BaseActivityLauncher {
- static String demo = "com.jogamp.opengl.test.android.NEWTGearsES1Activity";
- static String[] sys_pkgs = new String[] { "com.jogamp.common", "com.jogamp.opengl" };
- static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-
- @Override
- public void init() {
- final OrderedProperties props = getProperties();
- // props.setProperty("jogamp.debug.JNILibLoader", "true");
- // props.setProperty("jogamp.debug.NativeLibrary", "true");
- // properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
- // properties.setProperty("jogamp.debug.IOUtil", "true");
- // properties.setProperty("nativewindow.debug", "all");
- props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
- // properties.setProperty("jogl.debug", "all");
- // properties.setProperty("jogl.debug.GLProfile", "true");
- props.setProperty("jogl.debug.GLDrawable", "true");
- props.setProperty("jogl.debug.GLContext", "true");
- props.setProperty("jogl.debug.GLSLCode", "true");
- props.setProperty("jogl.debug.CapabilitiesChooser", "true");
- // properties.setProperty("jogl.debug.GLSLState", "true");
- // properties.setProperty("jogl.debug.DebugGL", "true");
- // properties.setProperty("jogl.debug.TraceGL", "true");
- // properties.setProperty("newt.debug", "all");
- props.setProperty("newt.debug.Window", "true");
- // properties.setProperty("newt.debug.Window.MouseEvent", "true");
- // properties.setProperty("newt.debug.Window.KeyEvent", "true");
- }
-
- @Override
- public String getActivityName() {
- return demo;
- }
- @Override
- public List<String> getSysPackages() {
- return Arrays.asList(sys_pkgs);
- }
-
- @Override
- public List<String> getUsrPackages() {
- return Arrays.asList(usr_pkgs);
- }
-}
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1Activity.java b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1Activity.java
deleted file mode 100644
index a3a51ef0c..000000000
--- a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1Activity.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Copyright 2011 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.
- */
-package com.jogamp.opengl.test.android;
-
-import com.jogamp.opengl.GLCapabilities;
-import com.jogamp.opengl.GLProfile;
-
-import jogamp.newt.driver.android.NewtBaseActivity;
-
-import com.jogamp.newt.event.MonitorEvent;
-import com.jogamp.newt.event.MonitorModeListener;
-import com.jogamp.newt.opengl.GLWindow;
-
-import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquareES1;
-import com.jogamp.opengl.util.Animator;
-
-import android.os.Bundle;
-import android.util.Log;
-
-public class NEWTRedSquareES1Activity extends NewtBaseActivity {
- static String TAG = "NEWTGearsES1Activity";
-
- @Override
- public void onCreate(final Bundle savedInstanceState) {
- Log.d(TAG, "onCreate - 0");
- super.onCreate(savedInstanceState);
-
- // create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
- final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
- Log.d(TAG, "req caps: "+caps);
- final GLWindow glWindow = GLWindow.create(caps);
- setContentView(getWindow(), glWindow);
-
- glWindow.addGLEventListener(new RedSquareES1(-1));
- glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
- @Override
- public void monitorModeChangeNotify(final MonitorEvent me) { }
- @Override
- public void monitorModeChanged(final MonitorEvent me, final boolean success) {
- System.err.println("MonitorMode Changed (success "+success+"): "+me);
- }
- });
- glWindow.setVisible(true);
- final Animator animator = new Animator(glWindow);
-
- animator.setUpdateFPSFrames(60, System.err);
- animator.resetFPSCounter();
- glWindow.resetFPSCounter();
-
- Log.d(TAG, "onCreate - X");
- }
-}
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1ActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1ActivityLauncher.java
deleted file mode 100644
index 380a37b93..000000000
--- a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1ActivityLauncher.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.jogamp.opengl.test.android;
-
-import java.util.Arrays;
-import java.util.List;
-
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
-
-public class NEWTRedSquareES1ActivityLauncher extends LauncherUtil.BaseActivityLauncher {
- static String demo = "com.jogamp.opengl.test.android.NEWTRedSquareES1Activity";
- static String[] sys_pkgs = new String[] { "com.jogamp.common", "com.jogamp.opengl" };
- static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-
- @Override
- public void init() {
- final OrderedProperties props = getProperties();
- // props.setProperty("jogamp.debug.JNILibLoader", "true");
- // props.setProperty("jogamp.debug.NativeLibrary", "true");
- // properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
- // properties.setProperty("jogamp.debug.IOUtil", "true");
- // properties.setProperty("nativewindow.debug", "all");
- props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
- // properties.setProperty("jogl.debug", "all");
- // properties.setProperty("jogl.debug.GLProfile", "true");
- props.setProperty("jogl.debug.GLDrawable", "true");
- props.setProperty("jogl.debug.GLContext", "true");
- props.setProperty("jogl.debug.GLSLCode", "true");
- props.setProperty("jogl.debug.CapabilitiesChooser", "true");
- // properties.setProperty("jogl.debug.GLSLState", "true");
- // properties.setProperty("jogl.debug.DebugGL", "true");
- // properties.setProperty("jogl.debug.TraceGL", "true");
- // properties.setProperty("newt.debug", "all");
- props.setProperty("newt.debug.Window", "true");
- // properties.setProperty("newt.debug.Window.MouseEvent", "true");
- // properties.setProperty("newt.debug.Window.KeyEvent", "true");
- }
-
- @Override
- public String getActivityName() {
- return demo;
- }
-
- @Override
- public List<String> getSysPackages() {
- return Arrays.asList(sys_pkgs);
- }
-
- @Override
- public List<String> getUsrPackages() {
- return Arrays.asList(usr_pkgs);
- }
-}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/GPURegionGLListener01.java b/src/test/com/jogamp/opengl/test/junit/graph/GPURegionGLListener01.java
new file mode 100644
index 000000000..e192cd2b9
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/GPURegionGLListener01.java
@@ -0,0 +1,299 @@
+/**
+ * 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.
+ */
+
+package com.jogamp.opengl.test.junit.graph;
+
+import com.jogamp.opengl.GL;
+import com.jogamp.opengl.GL2ES2;
+import com.jogamp.opengl.GLAutoDrawable;
+import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
+
+import com.jogamp.graph.curve.OutlineShape;
+import com.jogamp.graph.curve.opengl.GLRegion;
+import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.geom.plane.Path2F;
+import com.jogamp.graph.geom.plane.WindingRule;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.opengl.util.PMVMatrix;
+
+/** Demonstrate the rendering of multiple outlines into one region/OutlineShape
+ * These Outlines are not necessary connected or contained.
+ * The output of this demo shows two identical shapes but the left one
+ * has some vertices with off-curve flag set to true, and the right allt he vertices
+ * are on the curve. Demos the Res. Independent Nurbs based Curve rendering
+ *
+ */
+public class GPURegionGLListener01 extends GPURendererListenerBase01 {
+ final int shape_ctor_mode;
+ OutlineShape outlineShape = null;
+
+ public GPURegionGLListener01 (final RenderState rs, final int renderModes, final int sampleCount, final boolean debug, final boolean trace) {
+ this(1, rs, renderModes, sampleCount, debug, trace);
+ }
+
+ public GPURegionGLListener01 (final int shape_ctor_mode, final RenderState rs, final int renderModes, final int sampleCount, final boolean debug, final boolean trace) {
+ super(RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable), renderModes, debug, trace);
+ this.shape_ctor_mode = shape_ctor_mode;
+ rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);
+ setMatrix(-20, 00, -50, 0f, sampleCount);
+ }
+
+ private void createTestOutline00(){
+ outlineShape.addVertex(0.0f,-10.0f, true);
+ outlineShape.addVertex(15.0f,-10.0f, true);
+ outlineShape.addVertex(10.0f,5.0f, false);
+ outlineShape.addVertex(15.0f,10.0f, true);
+ outlineShape.addVertex(6.0f,15.0f, false);
+ outlineShape.addVertex(5.0f,8.0f, false);
+ outlineShape.addVertex(0.0f,10.0f,true);
+ outlineShape.closeLastOutline(true);
+ outlineShape.addEmptyOutline();
+ outlineShape.addVertex(5.0f,-5.0f,true);
+ outlineShape.addVertex(10.0f,-5.0f, false);
+ outlineShape.addVertex(10.0f,0.0f, true);
+ outlineShape.addVertex(5.0f,0.0f, false);
+ outlineShape.closeLastOutline(true);
+
+ /** Same shape as above but without any off-curve vertices */
+ final float offset = 30;
+ outlineShape.addEmptyOutline();
+ outlineShape.addVertex(offset+0.0f,-10.0f, true);
+ outlineShape.addVertex(offset+17.0f,-10.0f, true);
+ outlineShape.addVertex(offset+11.0f,5.0f, true);
+ outlineShape.addVertex(offset+16.0f,10.0f, true);
+ outlineShape.addVertex(offset+7.0f,15.0f, true);
+ outlineShape.addVertex(offset+6.0f,8.0f, true);
+ outlineShape.addVertex(offset+0.0f,10.0f, true);
+ outlineShape.closeLastOutline(true);
+ outlineShape.addEmptyOutline();
+ outlineShape.addVertex(offset+5.0f,0.0f, true);
+ outlineShape.addVertex(offset+5.0f,-5.0f, true);
+ outlineShape.addVertex(offset+10.0f,-5.0f, true);
+ outlineShape.addVertex(offset+10.0f,0.0f, true);
+ outlineShape.closeLastOutline(true);
+ }
+
+ private void createTestOutline01(){
+ outlineShape.moveTo(0.0f,-10.0f, 0f);
+ outlineShape.lineTo(15.0f,-10.0f, 0f);
+ outlineShape.quadTo(10.0f,5.0f,0f, 15.0f,10.0f,0f);
+ outlineShape.cubicTo(6.0f,15.0f,0f, 5.0f,8.0f,0f, 0.0f,10.0f,0f);
+ outlineShape.closePath();
+ outlineShape.moveTo(5.0f,-5.0f,0f);
+ outlineShape.quadTo(10.0f,-5.0f,0f, 10.0f,0.0f,0f);
+ outlineShape.quadTo(5.0f,0.0f,0f, 5.0f,-5.0f,0f);
+ outlineShape.closePath();
+
+ /** Same shape as above but without any off-curve vertices */
+ final float offset = 30;
+ outlineShape.moveTo(offset+0.0f,-10.0f,0f);
+ outlineShape.lineTo(offset+17.0f,-10.0f,0f);
+ outlineShape.lineTo(offset+11.0f,5.0f,0f);
+ outlineShape.lineTo(offset+16.0f,10.0f,0f);
+ outlineShape.lineTo(offset+7.0f,15.0f,0f);
+ outlineShape.lineTo(offset+6.0f,8.0f,0f);
+ outlineShape.lineTo(offset+0.0f,10.0f,0f);
+ outlineShape.closePath();
+ outlineShape.moveTo(offset+5.0f,0.0f,0f);
+ outlineShape.lineTo(offset+5.0f,-5.0f,0f);
+ outlineShape.lineTo(offset+10.0f,-5.0f,0f);
+ outlineShape.lineTo(offset+10.0f,0.0f,0f);
+ outlineShape.closePath();
+ }
+
+ private void createTestOutline02(){
+ final Path2F path = new Path2F(WindingRule.NON_ZERO);
+ path.moveTo(0.0f,-10.0f);
+ path.lineTo(15.0f,-10.0f);
+ path.quadTo(10.0f,5.0f, 15.0f,10.0f);
+ path.cubicTo(6.0f,15.0f, 5.0f,8.0f, 0.0f,10.0f);
+ path.closePath();
+ path.moveTo(5.0f,-5.0f);
+ path.quadTo(10.0f,-5.0f, 10.0f,0.0f);
+ path.quadTo(5.0f,0.0f, 5.0f,-5.0f);
+ path.closePath();
+
+ /** Same shape as above but without any off-curve vertices */
+ final float offset = 30;
+ path.moveTo(offset+0.0f,-10.0f);
+ path.lineTo(offset+17.0f,-10.0f);
+ path.lineTo(offset+11.0f,5.0f);
+ path.lineTo(offset+16.0f,10.0f);
+ path.lineTo(offset+7.0f,15.0f);
+ path.lineTo(offset+6.0f,8.0f);
+ path.lineTo(offset+0.0f,10.0f);
+ path.closePath();
+ path.moveTo(offset+5.0f,0.0f);
+ path.lineTo(offset+5.0f,-5.0f);
+ path.lineTo(offset+10.0f,-5.0f);
+ path.lineTo(offset+10.0f,0.0f);
+ path.closePath();
+
+ System.err.println("GPURegionGLListener01.createTestOutline02.X: path "+path);
+ path.printSegments(System.err);
+ outlineShape.addPath(path, false /* connect */);
+ }
+
+ private void createTestOutline03(){
+ {
+ final Path2F path = new Path2F(WindingRule.NON_ZERO);
+ path.moveTo(0.0f,-10.0f);
+ path.lineTo(15.0f,-10.0f);
+ path.quadTo(10.0f,5.0f, 15.0f,10.0f);
+ path.cubicTo(6.0f,15.0f, 5.0f,8.0f, 0.0f,10.0f);
+ path.closePath();
+ System.err.println("GPURegionGLListener01.createTestOutline03.0: path "+path);
+ path.printSegments(System.err);
+ {
+ final Path2F path2 = new Path2F(WindingRule.NON_ZERO);
+ path2.moveTo(5.0f,-5.0f);
+ path2.quadTo(10.0f,-5.0f, 10.0f,0.0f);
+ path2.quadTo(5.0f,0.0f, 5.0f,-5.0f);
+ path2.closePath();
+ System.err.println("GPURegionGLListener01.createTestOutline03.0: path2 "+path2);
+ path2.printSegments(System.err);
+ path.append(path2, false);
+ System.err.println("GPURegionGLListener01.createTestOutline03.1: path "+path);
+ path.printSegments(System.err);
+ }
+ outlineShape.addPath(path, false /* connect */);
+ }
+ {
+ /** Same shape as above but without any off-curve vertices */
+ final float offset = 30;
+ final Path2F path = new Path2F(WindingRule.NON_ZERO);
+ path.moveTo(offset+0.0f,-10.0f);
+ path.lineTo(offset+17.0f,-10.0f);
+ path.lineTo(offset+11.0f,5.0f);
+ path.lineTo(offset+16.0f,10.0f);
+ path.lineTo(offset+7.0f,15.0f);
+ path.lineTo(offset+6.0f,8.0f);
+ path.lineTo(offset+0.0f,10.0f);
+ path.closePath();
+ path.moveTo(offset+5.0f,0.0f);
+ path.lineTo(offset+5.0f,-5.0f);
+ path.lineTo(offset+10.0f,-5.0f);
+ path.lineTo(offset+10.0f,0.0f);
+ path.closePath();
+ System.err.println("GPURegionGLListener01.createTestOutline03.3: path "+path);
+ path.printSegments(System.err);
+ outlineShape.addPath(path, false /* connect */);
+ }
+
+ }
+
+ private void createTestOutline04(){
+ final Path2F path = new Path2F(WindingRule.NON_ZERO);
+
+ path.moveTo(0.0f,10.0f);
+ path.cubicTo(5.0f,8.0f, 6.0f,15.0f, 15.0f,10.0f);
+ path.quadTo(10.0f,5.0f, 15.0f,-10.0f);
+ path.lineTo(0.0f,-10.0f);
+ path.closePath();
+ path.moveTo(5.0f,-5.0f);
+ path.quadTo(5.0f,0.0f, 10.0f,0.0f);
+ path.quadTo(10.0f,-5.0f, 5.0f,-5.0f);
+ path.closePath();
+
+ /** Same shape as above but without any off-curve vertices */
+ final float offset = 30;
+ path.moveTo(offset+0.0f,10.0f);
+ path.lineTo(offset+6.0f,8.0f);
+ path.lineTo(offset+7.0f,15.0f);
+ path.lineTo(offset+16.0f,10.0f);
+ path.lineTo(offset+11.0f,5.0f);
+ path.lineTo(offset+17.0f,-10.0f);
+ path.lineTo(offset+0.0f,-10.0f);
+ path.closePath();
+ path.moveTo(offset+10.0f,0.0f);
+ path.lineTo(offset+10.0f,-5.0f);
+ path.lineTo(offset+5.0f,-5.0f);
+ path.lineTo(offset+5.0f,0.0f);
+ path.closePath();
+
+ System.err.println("GPURegionGLListener01.createTestOutline04.X: path "+path);
+ path.printSegments(System.err);
+ outlineShape.addPathRev(path, false /* connect */);
+ }
+
+ @Override
+ public void init(final GLAutoDrawable drawable) {
+ super.init(drawable);
+
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+ final RenderState rs = getRenderer().getRenderState();
+
+ gl.setSwapInterval(1);
+ gl.glEnable(GL.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_BLEND);
+ rs.setColorStatic(0.0f, 0.0f, 0.0f, 1.0f);
+
+ outlineShape = new OutlineShape(getRenderer().getRenderState().getVertexFactory());
+ switch( shape_ctor_mode ) {
+ case 0:
+ createTestOutline00();
+ break;
+ case 2:
+ createTestOutline02();
+ break;
+ case 3:
+ createTestOutline03();
+ break;
+ case 4:
+ createTestOutline04();
+ break;
+ default:
+ createTestOutline01();
+ break;
+ }
+ region = GLRegion.create(gl.getGLProfile(), getRenderModes(), null);
+ region.addOutlineShape(outlineShape, null, region.hasColorChannel() ? getRenderer().getRenderState().getColorStatic(new float[4]) : null);
+ }
+
+ @Override
+ public void display(final GLAutoDrawable drawable) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+ gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+
+ final RegionRenderer regionRenderer = getRenderer();
+ final PMVMatrix pmv = regionRenderer.getMatrix();
+ pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+ pmv.glLoadIdentity();
+ pmv.glTranslatef(getXTran(), getYTran(), getZTran());
+ pmv.glRotatef(getAngle(), 0, 1, 0);
+ if( weight != regionRenderer.getRenderState().getWeight() ) {
+ regionRenderer.getRenderState().setWeight(weight);
+ }
+ regionRenderer.enable(gl, true);
+ region.draw(gl, regionRenderer, getSampleCount());
+ regionRenderer.enable(gl, false);
+ }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/GPURegionGLListener10.java b/src/test/com/jogamp/opengl/test/junit/graph/GPURegionGLListener10.java
new file mode 100644
index 000000000..4cfd61777
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/GPURegionGLListener10.java
@@ -0,0 +1,138 @@
+/**
+ * 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.
+ */
+
+package com.jogamp.opengl.test.junit.graph;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.jogamp.opengl.GL;
+import com.jogamp.opengl.GL2ES2;
+import com.jogamp.opengl.GLAutoDrawable;
+import com.jogamp.opengl.GLProfile;
+import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
+
+import com.jogamp.graph.curve.OutlineShape;
+import com.jogamp.graph.curve.opengl.GLRegion;
+import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.opengl.util.PMVMatrix;
+
+/** Demonstrate the rendering of multiple OutlineShapes
+ * into one region
+ *
+ */
+public class GPURegionGLListener10 extends GPURendererListenerBase01 {
+ List<OutlineShape> outlineShapes = new ArrayList<OutlineShape>();
+
+ public GPURegionGLListener10 (final RenderState rs, final int renderModes, final int sampleCount, final boolean debug, final boolean trace) {
+ super(RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable), renderModes, debug, trace);
+ rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);
+ setMatrix(-20, 00, -50, 0f, sampleCount);
+ }
+
+ private void createTestOutline(final GLProfile glp){
+ OutlineShape shape = new OutlineShape(getRenderer().getRenderState().getVertexFactory());
+ outlineShapes.add(shape);
+ shape.addVertex(0.0f,-10.0f,true);
+ shape.addVertex(15.0f,-10.0f, true);
+ shape.addVertex(10.0f,5.0f, false);
+ shape.addVertex(15.0f,10.0f, true);
+ shape.addVertex(6.0f,15.0f, false);
+ shape.addVertex(5.0f,8.0f, false);
+ shape.addVertex(0.0f,10.0f,true);
+ shape.closeLastOutline(true);
+ shape.addEmptyOutline();
+ shape.addVertex(5.0f,-5.0f,true);
+ shape.addVertex(10.0f,-5.0f, false);
+ shape.addVertex(10.0f,0.0f, true);
+ shape.addVertex(5.0f,0.0f, false);
+ shape.closeLastOutline(true);
+
+ /** Same shape as above but without any off-curve vertices */
+ shape = new OutlineShape(getRenderer().getRenderState().getVertexFactory());
+ outlineShapes.add(shape);
+ final float offset = 30;
+ shape.addVertex(offset+0.0f,-10.0f, true);
+ shape.addVertex(offset+17.0f,-10.0f, true);
+ shape.addVertex(offset+11.0f,5.0f, true);
+ shape.addVertex(offset+16.0f,10.0f, true);
+ shape.addVertex(offset+7.0f,15.0f, true);
+ shape.addVertex(offset+6.0f,8.0f, true);
+ shape.addVertex(offset+0.0f,10.0f, true);
+ shape.closeLastOutline(true);
+ shape.addEmptyOutline();
+ shape.addVertex(offset+5.0f,0.0f, true);
+ shape.addVertex(offset+5.0f,-5.0f, true);
+ shape.addVertex(offset+10.0f,-5.0f, true);
+ shape.addVertex(offset+10.0f,0.0f, true);
+ shape.closeLastOutline(true);
+
+ region = GLRegion.create(glp, getRenderModes(), null);
+ region.addOutlineShapes(outlineShapes, null, null);
+ }
+
+ @Override
+ public void init(final GLAutoDrawable drawable) {
+ super.init(drawable);
+
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+ final RenderState rs = getRenderer().getRenderState();
+
+ gl.setSwapInterval(1);
+ gl.glEnable(GL.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_BLEND);
+ rs.setColorStatic(0.0f, 0.0f, 0.0f, 1.0f);
+
+ createTestOutline(gl.getGLProfile());
+ }
+
+ @Override
+ public void display(final GLAutoDrawable drawable) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+ gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+
+ final RegionRenderer regionRenderer = getRenderer();
+
+ final PMVMatrix pmv = regionRenderer.getMatrix();
+ pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+ pmv.glLoadIdentity();
+ pmv.glTranslatef(getXTran(), getYTran(), getZTran());
+ pmv.glRotatef(getAngle(), 0, 1, 0);
+ if( weight != regionRenderer.getRenderState().getWeight() ) {
+ regionRenderer.getRenderState().setWeight(weight);
+ }
+ regionRenderer.enable(gl, true);
+ region.draw(gl, regionRenderer, getSampleCount());
+ regionRenderer.enable(gl, false);
+
+ }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/GPURendererListenerBase01.java b/src/test/com/jogamp/opengl/test/junit/graph/GPURendererListenerBase01.java
new file mode 100644
index 000000000..b99d91070
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/GPURendererListenerBase01.java
@@ -0,0 +1,361 @@
+/**
+ * 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.
+ */
+package com.jogamp.opengl.test.junit.graph;
+
+import java.io.File;
+import java.io.IOException;
+
+import com.jogamp.opengl.FPSCounter;
+import com.jogamp.opengl.GL;
+import com.jogamp.opengl.GL2ES2;
+import com.jogamp.opengl.GLAnimatorControl;
+import com.jogamp.opengl.GLAutoDrawable;
+import com.jogamp.opengl.GLEventListener;
+import com.jogamp.opengl.GLException;
+import com.jogamp.opengl.GLPipelineFactory;
+import com.jogamp.opengl.GLRunnable;
+import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
+
+import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.curve.opengl.GLRegion;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.font.FontScale;
+import com.jogamp.newt.Window;
+import com.jogamp.newt.event.KeyEvent;
+import com.jogamp.newt.event.KeyListener;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.math.geom.AABBox;
+import com.jogamp.opengl.util.GLReadBufferUtil;
+import com.jogamp.opengl.util.PMVMatrix;
+
+/**
+ *
+ * Action Keys:
+ * - 1/2: zoom in/out
+ * - 6/7: 2nd pass texture size
+ * - 0/9: rotate
+ * - Q/W: change weight
+ * - v: toggle v-sync
+ * - s: screenshot
+ */
+public abstract class GPURendererListenerBase01 implements GLEventListener {
+ private final RegionRenderer renderer;
+ private final int renderModes;
+ private final boolean debug;
+ private final boolean trace;
+
+ protected GLRegion region;
+
+ private final GLReadBufferUtil screenshot;
+
+ private KeyAction keyAction;
+
+ private volatile GLAutoDrawable autoDrawable = null;
+
+ private final float[] position = new float[] {0,0,0};
+
+ protected final float zNear = 0.1f, zFar = 7000f;
+ /** Describing the bounding box in model-coordinates of the near-plane parallel at distance one. */
+ protected final AABBox nearPlane1Box;
+
+ private float xTran = -10;
+ private float yTran = 10;
+ private float ang = 0f;
+ private float zTran = -70f;
+ private final int[] sampleCount = new int[] { 4 };
+
+ protected volatile float weight = 1.0f;
+ boolean ignoreInput = false;
+
+ public GPURendererListenerBase01(final RegionRenderer renderer, final int renderModes, final boolean debug, final boolean trace) {
+ this.renderer = renderer;
+ this.renderModes = renderModes;
+ this.debug = debug;
+ this.trace = trace;
+ this.screenshot = new GLReadBufferUtil(false, false);
+ nearPlane1Box = new AABBox();
+ }
+
+ public final RegionRenderer getRenderer() { return renderer; }
+ public final int getRenderModes() { return renderModes; }
+ public final float getZTran() { return zTran; }
+ public final float getXTran() { return xTran; }
+ public final float getYTran() { return yTran; }
+ public final float getAngle() { return ang; }
+ public final int[] getSampleCount() { return sampleCount; }
+ public final float[] getPosition() { return position; }
+
+ public void setMatrix(final float xtrans, final float ytrans, final float zTran, final float angle, final int sampleCount) {
+ this.xTran = xtrans;
+ this.yTran = ytrans;
+ this.zTran = zTran;
+ this.ang = angle;
+ this.sampleCount[0] = sampleCount;
+ }
+
+ @Override
+ public void init(final GLAutoDrawable drawable) {
+ final Object upObj = drawable.getUpstreamWidget();
+ if( upObj instanceof Window ) {
+ final Window window = (Window) upObj;
+ final float[] sPpMM = window.getPixelsPerMM(new float[2]);
+ final float[] sDPI = FontScale.perMMToPerInch( new float[] { sPpMM[0], sPpMM[1] } );
+ System.err.println("DPI "+sDPI[0]+" x "+sDPI[1]+", "+sPpMM[0]+" x "+sPpMM[1]+" pixel/mm");
+
+ final float[] hasSurfacePixelScale1 = window.getCurrentSurfaceScale(new float[2]);
+ System.err.println("HiDPI PixelScale: "+hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
+ }
+ autoDrawable = drawable;
+ GL2ES2 gl = drawable.getGL().getGL2ES2();
+ if(debug) {
+ gl = gl.getContext().setGL( GLPipelineFactory.create("com.jogamp.opengl.Debug", null, gl, null) ).getGL2ES2();
+ }
+ if(trace) {
+ gl = gl.getContext().setGL( GLPipelineFactory.create("com.jogamp.opengl.Trace", null, gl, new Object[] { System.err } ) ).getGL2ES2();
+ }
+ System.err.println("*** "+gl.getContext().getGLVersion());
+ System.err.println("*** GLDebugMessage "+gl.getContext().isGLDebugMessageEnabled());
+ MSAATool.dump(drawable);
+ gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
+ getRenderer().init(gl);
+ }
+
+ public static void mapWin2ObjectCoords(final PMVMatrix pmv, final int[] view,
+ final float zNear, final float zFar,
+ final float orthoX, final float orthoY, final float orthoDist,
+ final float[] winZ, final float[] objPos) {
+ winZ[0] = (1f/zNear-1f/orthoDist)/(1f/zNear-1f/zFar);
+ pmv.gluUnProject(orthoX, orthoY, winZ[0], view, 0, objPos, 0);
+ }
+
+ @Override
+ public void reshape(final GLAutoDrawable drawable, final int xstart, final int ystart, final int width, final int height) {
+ final PMVMatrix pmv = renderer.getMatrix();
+ renderer.reshapePerspective(45.0f, width, height, zNear, zFar);
+ pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+ pmv.glLoadIdentity();
+ System.err.printf("Reshape: zNear %f, zFar %f%n", zNear, zFar);
+ System.err.printf("Reshape: Frustum: %s%n", pmv.glGetFrustum());
+ {
+ final float orthoDist = 1f;
+ final float[] obj00Coord = new float[3];
+ final float[] obj11Coord = new float[3];
+ final float[] winZ = new float[1];
+ final int[] view = new int[] { 0, 0, width, height };
+
+ mapWin2ObjectCoords(pmv, view, zNear, zFar, 0f, 0f, orthoDist, winZ, obj00Coord);
+ System.err.printf("Reshape: mapped.00: [%f, %f, %f], winZ %f -> [%f, %f, %f]%n", 0f, 0f, orthoDist, winZ[0], obj00Coord[0], obj00Coord[1], obj00Coord[2]);
+
+ mapWin2ObjectCoords(pmv, view, zNear, zFar, width, height, orthoDist, winZ, obj11Coord);
+ System.err.printf("Reshape: mapped.11: [%f, %f, %f], winZ %f -> [%f, %f, %f]%n", (float)width, (float)height, orthoDist, winZ[0], obj11Coord[0], obj11Coord[1], obj11Coord[2]);
+
+ nearPlane1Box.setSize( obj00Coord[0], // lx
+ obj00Coord[1], // ly
+ obj00Coord[2], // lz
+ obj11Coord[0], // hx
+ obj11Coord[1], // hy
+ obj11Coord[2] );// hz
+ System.err.printf("Reshape: dist1Box: %s%n", nearPlane1Box);
+ }
+
+ dumpMatrix();
+ // System.err.println("Reshape: "+renderer.getRenderState());
+ }
+
+ @Override
+ public void dispose(final GLAutoDrawable drawable) {
+ autoDrawable = null;
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+ if(null != region) {
+ region.destroy(gl);
+ }
+ screenshot.dispose(gl);
+ renderer.destroy(gl);
+ }
+
+ public void zoom(final int v){
+ zTran += v;
+ dumpMatrix();
+ }
+
+ public void move(final float x, final float y){
+ xTran += x;
+ yTran += y;
+ dumpMatrix();
+ }
+ public void rotate(final float delta){
+ ang += delta;
+ ang %= 360.0f;
+ dumpMatrix();
+ }
+ public void editGlobalWeight(final float delta) {
+ if( !RenderState.isWeightValid(weight+delta) ) {
+ return;
+ }
+ weight += delta;
+ System.err.println("Global Weight: "+ weight);
+ }
+
+ void dumpMatrix() {
+ System.err.println("Matrix: " + xTran + " / " + yTran + " / "+zTran + " @ "+ang);
+ }
+
+ /** Attach the input listener to the window */
+ public void attachInputListenerTo(final GLWindow window) {
+ if ( null == keyAction ) {
+ keyAction = new KeyAction();
+ window.addKeyListener(keyAction);
+ }
+ }
+
+ public void detachInputListenerFrom(final GLWindow window) {
+ if ( null == keyAction ) {
+ return;
+ }
+ window.removeKeyListener(keyAction);
+ }
+
+ public void printScreen(final GLAutoDrawable drawable, final String dir, final String tech, final String objName, final boolean exportAlpha) throws GLException, IOException {
+ final String sw = String.format("_s%02d-%s-Z%04d-snap%02d-%03dx%03d", sampleCount[0], objName, (int)Math.abs(zTran), screenshot_num++, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
+ final String filename = dir + tech + sw +".png";
+ if(screenshot.readPixels(drawable.getGL(), false)) {
+ screenshot.write(new File(filename));
+ }
+ }
+ private int screenshot_num = 0;
+
+ public void printScreenOnGLThread(final GLAutoDrawable drawable, final String dir, final String tech, final String objName, final boolean exportAlpha) {
+ drawable.invoke(false, new GLRunnable() {
+ @Override
+ public boolean run(final GLAutoDrawable drawable) {
+ try {
+ printScreen(drawable, dir, tech, objName, exportAlpha);
+ } catch (final GLException e) {
+ e.printStackTrace();
+ } catch (final IOException e) {
+ e.printStackTrace();
+ }
+ return true;
+ }
+ });
+ }
+
+ public void setIgnoreInput(final boolean v) {
+ ignoreInput = v;
+ }
+ public boolean getIgnoreInput() {
+ return ignoreInput;
+ }
+
+ public class KeyAction implements KeyListener {
+ @Override
+ public void keyPressed(final KeyEvent arg0) {
+ if(ignoreInput) {
+ return;
+ }
+
+ if(arg0.getKeyCode() == KeyEvent.VK_1){
+ zoom(10);
+ }
+ else if(arg0.getKeyCode() == KeyEvent.VK_2){
+ zoom(-10);
+ }
+ else if(arg0.getKeyCode() == KeyEvent.VK_UP){
+ move(0, -1);
+ }
+ else if(arg0.getKeyCode() == KeyEvent.VK_DOWN){
+ move(0, 1);
+ }
+ else if(arg0.getKeyCode() == KeyEvent.VK_LEFT){
+ move(-1, 0);
+ }
+ else if(arg0.getKeyCode() == KeyEvent.VK_RIGHT){
+ move(1, 0);
+ }
+ else if(arg0.getKeyCode() == KeyEvent.VK_6){
+ sampleCount[0] -= 1;
+ System.err.println("Sample Count: " + sampleCount[0]);
+ }
+ else if(arg0.getKeyCode() == KeyEvent.VK_7){
+ sampleCount[0] += 1;
+ System.err.println("Sample Count: " + sampleCount[0]);
+ }
+ else if(arg0.getKeyCode() == KeyEvent.VK_0){
+ rotate(1);
+ }
+ else if(arg0.getKeyCode() == KeyEvent.VK_9){
+ rotate(-1);
+ }
+ else if(arg0.getKeyCode() == KeyEvent.VK_Q){
+ editGlobalWeight(-0.1f);
+ }
+ else if(arg0.getKeyCode() == KeyEvent.VK_W){
+ editGlobalWeight(0.1f);
+ }
+ else if(arg0.getKeyCode() == KeyEvent.VK_V) {
+ if(null != autoDrawable) {
+ autoDrawable.invoke(false, new GLRunnable() {
+ @Override
+ public boolean run(final GLAutoDrawable drawable) {
+ final GL gl = drawable.getGL();
+ final int _i = gl.getSwapInterval();
+ final int i;
+ switch(_i) {
+ case 0: i = -1; break;
+ case -1: i = 1; break;
+ case 1: i = 0; break;
+ default: i = 1; break;
+ }
+ gl.setSwapInterval(i);
+
+ final GLAnimatorControl a = drawable.getAnimator();
+ if( null != a ) {
+ a.resetFPSCounter();
+ }
+ if(drawable instanceof FPSCounter) {
+ ((FPSCounter)drawable).resetFPSCounter();
+ }
+ System.err.println("Swap Interval: "+_i+" -> "+i+" -> "+gl.getSwapInterval());
+ return true;
+ }
+ });
+ }
+ }
+ else if(arg0.getKeyCode() == KeyEvent.VK_S){
+ if(null != autoDrawable) {
+ final String modeS = Region.getRenderModeString(renderModes);
+ final String type = modeS + ( Region.hasVariableWeight(renderModes) ? "-vc" : "-uc" ) ;
+ printScreenOnGLThread(autoDrawable, "./", "demo-"+type, "", false);
+ }
+ }
+ }
+ @Override
+ public void keyReleased(final KeyEvent arg0) {}
+ }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/GPUTextRendererListenerBase01.java b/src/test/com/jogamp/opengl/test/junit/graph/GPUTextRendererListenerBase01.java
new file mode 100644
index 000000000..8f813d537
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/GPUTextRendererListenerBase01.java
@@ -0,0 +1,588 @@
+/**
+ * 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.
+ */
+package com.jogamp.opengl.test.junit.graph;
+
+import java.io.IOException;
+
+import com.jogamp.opengl.GL;
+import com.jogamp.opengl.GL2ES2;
+import com.jogamp.opengl.GLAnimatorControl;
+import com.jogamp.opengl.GLAutoDrawable;
+import com.jogamp.opengl.GLException;
+import com.jogamp.opengl.GLProfile;
+import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
+import com.jogamp.common.util.InterruptSource;
+import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.curve.opengl.GLRegion;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.curve.opengl.TextRegionUtil;
+import com.jogamp.graph.font.Font;
+import com.jogamp.graph.font.FontFactory;
+import com.jogamp.graph.font.FontScale;
+import com.jogamp.graph.font.FontSet;
+import com.jogamp.graph.geom.plane.AffineTransform;
+import com.jogamp.newt.Window;
+import com.jogamp.newt.event.KeyEvent;
+import com.jogamp.newt.event.KeyListener;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.math.geom.AABBox;
+import com.jogamp.opengl.util.PMVMatrix;
+
+/**
+ *
+ * GPURendererListenerBase01 Keys:
+ * - 1/2: zoom in/out
+ * - 6/7: 2nd pass texture size
+ * - 0/9: rotate
+ * - v: toggle v-sync
+ * - s: screenshot
+ *
+ * Additional Keys:
+ * - 3/4: font +/-
+ * - h: toogle draw 'font set'
+ * - f: toggle draw fps
+ * - space: toggle font (ubuntu/java)
+ * - i: live input text input (CR ends it, backspace supported)
+ */
+public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerBase01 {
+ public final TextRegionUtil textRegionUtil;
+ private final GLRegion regionFPS, regionHead, regionBottom;
+ int fontSet = FontFactory.UBUNTU;
+ Font font;
+
+ int headType = 1;
+ boolean drawFPS = true;
+ final float fontSizeFName = 10f;
+ final float fontSizeFPS = 10f;
+ final int[] sampleCountFPS = new int[] { 8 };
+ float fontSizeHead = 12f;
+ float fontSizeCenter = 16f;
+ float dpiV = 96;
+ float ppmmV = 1;
+ final int fontSizeModulo = 100;
+ String fontName;
+ AABBox fontNameBox;
+ String headtext;
+ AABBox headbox;
+
+ protected final AffineTransform tempT1 = new AffineTransform();
+ protected final AffineTransform tempT2 = new AffineTransform();
+
+ static final String text2 = "The quick brown fox jumps over the lazy dog";
+ public static final String text_help =
+ "JOGL: Java™ Binding for OpenGL®, providing hardware-accelerated 3D graphics.\n\n"+
+ "JOGAMP graph demo using Resolution Independent NURBS\n"+
+ "JOGAMP JOGL - OpenGL ES2 profile\n"+
+ "Press 1/2 to zoom in/out the below text\n"+
+ "Press 3/4 to incr/decs font size (alt: head, w/o bottom)\n"+
+ "Press 6/7 to edit texture size if using VBAA\n"+
+ "Press 0/9 to rotate the below string\n"+
+ "Press s to screenshot\n"+
+ "Press v to toggle vsync\n"+
+ "Press i for live input text input (CR ends it, backspace supported)\n"+
+ "Press f to toggle fps. H for different text, space for font type\n";
+
+ public static final String textX1 =
+ "JOGL: Java™ Binding for OpenGL®, providing hardware-accelerated 3D graphics.\n\n"+
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec nec sapien tellus. \n"+
+ "Ut purus odio, rhoncus sit amet commodo eget, ullamcorper vel urna. Mauris ultricies \n"+
+ "quam iaculis urna cursus ornare. Nullam ut felis a ante ultrices ultricies nec a elit. \n"+
+ "In hac habitasse platea dictumst. Vivamus et mi a quam lacinia pharetra at venenatis est. \n"+
+ "Morbi quis bibendum nibh. Donec lectus orci, sagittis in consequat nec, volutpat nec nisi. \n"+
+ "Donec ut dolor et nulla tristique varius. In nulla magna, fermentum id tempus quis, semper \n"+
+ "in lorem. Maecenas in ipsum ac justo scelerisque sollicitudin. Quisque sit amet neque lorem, \n" +
+ "-------Press H to change text---------";
+
+ public static final String textX2 =
+ "I “Ask Jeff” or ‘Ask Jeff’. Take the chef d’œuvre! Two of [of] (of) ‘of’ “of” of? of! of*.\n"+
+ "Les Woëvres, the Fôret de Wœvres, the Voire and Vauvise. Yves is in heaven; D’Amboise is in jail.\n"+
+ "Lyford’s in Texas & L’Anse-aux-Griffons in Québec; the Łyna in Poland. Yriarte, Yciar and Ysaÿe are at Yale.\n"+
+ "Kyoto and Ryotsu are both in Japan, Kwikpak on the Yukon delta, Kvæven in Norway, Kyulu in Kenya, not in Rwanda.…\n"+
+ "Von-Vincke-Straße in Münster, Vdovino in Russia, Ytterbium in the periodic table. Are Toussaint L’Ouverture, Wölfflin, Wolfe,\n"+
+ "Miłosz and Wū Wŭ all in the library? 1510–1620, 11:00 pm, and the 1980s are over. X\n"+
+ "-------Press H to change text---------";
+
+ public static final String textX20 =
+ "I “Ask Jeff” or ‘Ask Jeff’. Take the chef d’œuvre! Two of [of] (of) ‘of’ “of” of? of! of*.\n"+
+ "Two of [of] (of) ‘of’ “of” of? of! of*. Ydes, Yffignac and Ygrande are in France: so are Ypres,\n"+
+ "Les Woëvres, the Fôret de Wœvres, the Voire and Vauvise. Yves is in heaven; D’Amboise is in jail.\n"+
+ "Lyford’s in Texas & L’Anse-aux-Griffons in Québec; the Łyna in Poland. Yriarte, Yciar and Ysaÿe are at Yale.\n"+
+ "Kyoto and Ryotsu are both in Japan, Kwikpak on the Yukon delta, Kvæven in Norway, Kyulu in Kenya, not in Rwanda.…\n"+
+ "Walton’s in West Virginia, but «Wren» is in Oregon. Tlálpan is near Xochimilco in México.\n"+
+ "The Zygos & Xylophagou are in Cyprus, Zwettl in Austria, Fænø in Denmark, the Vøringsfossen and Værøy in Norway.\n"+
+ "Tchula is in Mississippi, the Tittabawassee in Michigan. Twodot is here in Montana, Ywamun in Burma.\n"+
+ "Yggdrasil and Ymir, Yngvi and Vóden, Vídrið and Skeggjöld and Týr are all in the Eddas.\n"+
+ "Tørberget and Våg, of course, are in Norway, Ktipas and Tmolos in Greece, but Vázquez is in Argentina, Vreden in Germany,\n"+
+ "Von-Vincke-Straße in Münster, Vdovino in Russia, Ytterbium in the periodic table. Are Toussaint L’Ouverture, Wölfflin, Wolfe,\n"+
+ "Miłosz and Wū Wŭ all in the library? 1510–1620, 11:00 pm, and the 1980s are over.\n"+
+ "Ut purus odio, rhoncus sit amet commodo eget, ullamcorper vel urna. Mauris ultricies \n"+
+ "-------Press H to change text---------";
+
+ static final String textXLast = "abcdefghijklmnopqrstuvwxyz\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n0123456789.:,;(*!?/\\\")$%^&-+@~#<>{}[]";
+
+ Window upstream_window = null;
+ StringBuilder userString = new StringBuilder(textX1);
+ boolean userInput = false;
+ public GPUTextRendererListenerBase01(final GLProfile glp, final RenderState rs, final int renderModes, final int sampleCount, final boolean blending, final boolean debug, final boolean trace) {
+ // NOTE_ALPHA_BLENDING: We use alpha-blending
+ super(RegionRenderer.create(rs, blending ? RegionRenderer.defaultBlendEnable : null,
+ blending ? RegionRenderer.defaultBlendDisable : null),
+ renderModes, debug, trace);
+ rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);
+ this.textRegionUtil = new TextRegionUtil(renderModes);
+ this.regionFPS = GLRegion.create(glp, renderModes, null);
+ this.regionHead = GLRegion.create(glp, renderModes, null);
+ this.regionBottom = GLRegion.create(glp, renderModes, null);
+ setFontSet(fontSet, FontSet.FAMILY_LIGHT, FontSet.STYLE_NONE);
+ setMatrix(0, 0, 0, 0f, sampleCount);
+ }
+
+ void switchHeadBox() {
+ setHeadBox( ( headType + 1 ) % 5, true );
+ }
+ public int getHeadBoxType() { return headType; }
+ public AABBox getHeadBox() { return headbox; }
+ public void setHeadBox(final int choice, final boolean resize) {
+ headType = choice % 5 ;
+ switch(headType) {
+ case 0:
+ headtext = null;
+ break;
+
+ case 1:
+ headtext= textX1;
+ break;
+ case 2:
+ headtext= textX2;
+ break;
+ case 3:
+ headtext= text_help;
+ break;
+
+ default:
+ headtext = textXLast;
+ }
+ if(resize && null != headtext) {
+ headbox = font.getMetricBounds(headtext);
+ if( headtext != text_help ) {
+ final float pxSz = FontScale.toPixels(fontSizeHead, dpiV);
+ upsizeWindowSurface(upstream_window, true, (int)(headbox.getWidth()*pxSz*1.1f), (int)(headbox.getHeight()*pxSz*2f));
+ }
+ }
+ }
+
+ public void setHeadBox(final String text, final boolean resize) {
+ headtext = text;
+ if(resize && null != headtext) {
+ headbox = font.getMetricBounds(headtext);
+ if( headtext != text_help ) {
+ final float pxSz = FontScale.toPixels(fontSizeHead, dpiV);
+ upsizeWindowSurface(upstream_window, true, (int)(headbox.getWidth()*pxSz*1.1f), (int)(headbox.getHeight()*pxSz*2f));
+ }
+ }
+ }
+
+ public static void upsizeWindowSurface(final Window window, final boolean off_thread, final int w, final int h) {
+ if( null == window ) {
+ return;
+ }
+ final int w2 = Math.max(window.getSurfaceWidth(), w);
+ final int h2 = Math.max(window.getSurfaceHeight(), h);
+ System.err.println("upsizeWindowSurface: "+window.getSurfaceWidth()+"x"+window.getSurfaceHeight()+" -> "+w+"x"+h+" -> "+w2+"x"+h2);
+ if( off_thread ) {
+ new InterruptSource.Thread() {
+ @Override
+ public void run() {
+ window.setSurfaceSize(w2, h2);
+ } }.start();
+ } else {
+ window.setSurfaceSize(w2, h2);
+ }
+ }
+
+ @Override
+ public void init(final GLAutoDrawable drawable) {
+ super.init(drawable);
+ final Object upObj = drawable.getUpstreamWidget();
+ if( upObj instanceof Window ) {
+ upstream_window = (Window) upObj;
+ final float[] sPpMM = upstream_window.getPixelsPerMM(new float[2]);
+ final float[] sDPI = FontScale.perMMToPerInch( new float[] { sPpMM[0], sPpMM[1] } );
+ dpiV = sDPI[1];
+ ppmmV = sPpMM[1];
+ System.err.println("Using vertical screen DPI of "+dpiV+", "+ppmmV+" pixel/mm");
+ } else {
+ System.err.println("Using vertical default DPI of "+dpiV+", "+ppmmV+" pixel/mm");
+ }
+ fontNameBox = font.getGlyphBounds(fontName, tempT1, tempT2);
+ setHeadBox(headType, true);
+ {
+ final float pixelSizeFName = FontScale.toPixels(fontSizeFName, dpiV);
+ System.err.println("XXX: fontName size "+fontSizeFName+"pt, dpiV "+dpiV+" -> "+pixelSizeFName+"px");
+ System.err.println("XXX: fontName boxM fu "+font.getMetricBoundsFU(fontName));
+ System.err.println("XXX: fontName boxG fu "+font.getGlyphBoundsFU(fontName, tempT1, tempT2));
+ System.err.println("XXX: fontName boxM em "+font.getMetricBounds(fontName));
+ System.err.println("XXX: fontName boxG em "+font.getGlyphBounds(fontName, tempT1, tempT2));
+ System.err.println("XXX: fontName box height px "+(fontNameBox.getHeight() * pixelSizeFName));
+ }
+ }
+
+ @Override
+ public void reshape(final GLAutoDrawable drawable, final int xstart, final int ystart, final int width, final int height) {
+ super.reshape(drawable, xstart, ystart, width, height);
+ final Object upObj = drawable.getUpstreamWidget();
+ if( upObj instanceof Window ) {
+ upstream_window = (Window) upObj;
+ }
+ final float dist = 100f;
+ nearPlaneX0 = nearPlane1Box.getMinX() * dist;
+ nearPlaneY0 = nearPlane1Box.getMinY() * dist;
+ nearPlaneZ0 = nearPlane1Box.getMinZ() * dist;
+ final float xd = nearPlane1Box.getWidth() * dist;
+ final float yd = nearPlane1Box.getHeight() * dist;
+ nearPlaneSx = xd / width;
+ nearPlaneSy = yd / height;
+ nearPlaneS = nearPlaneSy;
+ System.err.printf("Scale: [%f x %f] / [%d x %d] = [%f, %f] -> %f%n", xd, yd, width, height, nearPlaneSx, nearPlaneSy, nearPlaneS);
+ }
+ float nearPlaneX0, nearPlaneY0, nearPlaneZ0, nearPlaneSx, nearPlaneSy, nearPlaneS;
+
+ @Override
+ public void dispose(final GLAutoDrawable drawable) {
+ upstream_window = null;
+ regionFPS.destroy(drawable.getGL().getGL2ES2());
+ regionHead.destroy(drawable.getGL().getGL2ES2());
+ regionBottom.destroy(drawable.getGL().getGL2ES2());
+ super.dispose(drawable);
+ }
+
+ @Override
+ public void display(final GLAutoDrawable drawable) {
+ final Object upObj = drawable.getUpstreamWidget();
+ if( upObj instanceof Window ) {
+ upstream_window = (Window) upObj;
+ }
+ final int width = drawable.getSurfaceWidth();
+ final int height = drawable.getSurfaceHeight();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+ gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+
+ // final float zDistance0 = 500f;
+ // final float zDistance1 = 400f;
+ // final float[] objPos = new float[3];
+ // final float[] winZ = new float[1];
+ // final int[] view = new int[] { 0, 0, drawable.getWidth(), drawable.getHeight() };
+
+ final RegionRenderer renderer = getRenderer();
+ final RenderState rs = renderer.getRenderState();
+ final PMVMatrix pmv = renderer.getMatrix();
+ pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+ pmv.glLoadIdentity();
+ rs.setColorStatic(0.1f, 0.1f, 0.1f, 1.0f);
+ final float pixelSizeFName = FontScale.toPixels(fontSizeFName, dpiV);
+ final float pixelSizeHead = FontScale.toPixels(fontSizeHead, dpiV);
+ final float mmSizeHead = pixelSizeHead / ppmmV;
+ final float pixelSizeCenter = FontScale.toPixels(fontSizeCenter, dpiV);
+ final float mmSizeCenter = pixelSizeCenter / ppmmV;
+
+ renderer.enable(gl, true);
+
+ if( drawFPS ) {
+ pmv.glPushMatrix();
+ final float pixelSizeFPS = FontScale.toPixels(fontSizeFPS, dpiV);
+ final float lfps, tfps, td;
+ final GLAnimatorControl animator = drawable.getAnimator();
+ if( null != animator ) {
+ lfps = animator.getLastFPS();
+ tfps = animator.getTotalFPS();
+ td = animator.getTotalFPSDuration()/1000f;
+ } else {
+ lfps = 0f;
+ tfps = 0f;
+ td = 0f;
+ }
+ final String modeS = Region.getRenderModeString(regionFPS.getRenderModes());
+ final String text = String.format("%03.1f/%03.1f fps, v-sync %d, dpiV %.2f %.2f px/mm, font[head %.1fpt %.2fpx %.2fmm, center %.1fpt %.2fpx %.2fmm], %s-samples[%d, this %d], blend %b, alpha %d",
+ lfps, tfps, gl.getSwapInterval(), dpiV, ppmmV,
+ fontSizeHead, pixelSizeHead, mmSizeHead,
+ fontSizeCenter, pixelSizeCenter, mmSizeCenter,
+ modeS, getSampleCount()[0], sampleCountFPS[0],
+ renderer.getRenderState().isHintMaskSet(RenderState.BITHINT_BLENDING_ENABLED),
+ drawable.getChosenGLCapabilities().getAlphaBits());
+
+ // bottom, half line up
+ pmv.glTranslatef(nearPlaneX0, nearPlaneY0+(nearPlaneS * pixelSizeFPS / 2f), nearPlaneZ0);
+ {
+ final float sxy = nearPlaneS * pixelSizeFPS;
+ pmv.glScalef(sxy, sxy, 1.0f);
+ }
+ // No cache, keep region alive!
+ TextRegionUtil.drawString3D(gl, regionFPS.clear(gl), renderer, font, text, null, sampleCountFPS, tempT1, tempT2);
+ pmv.glPopMatrix();
+ }
+
+ // float dx = width - ( fontNameBox.getWidth() + font.getAdvanceWidth( Glyph.ID_SPACE ) ) * pixelSizeFName;
+ float dx = width - ( fontNameBox.getWidth() + 2 * font.getAdvanceWidth( font.getGlyphID('X') ) ) * pixelSizeFName;
+ float dy = height - fontNameBox.getHeight() * pixelSizeFName;
+ {
+ pmv.glPushMatrix();
+ pmv.glTranslatef(nearPlaneX0+(dx*nearPlaneSx), nearPlaneY0+(dy*nearPlaneSy), nearPlaneZ0);
+ {
+ final float sxy = nearPlaneS * pixelSizeFName;
+ pmv.glScalef(sxy, sxy, 1.0f);
+ }
+ // System.err.printf("FontN: [%f %f] -> [%f %f]%n", dx, dy, nearPlaneX0+(dx*nearPlaneSx), nearPlaneY0+(dy*nearPlaneSy));
+ textRegionUtil.drawString3D(gl, renderer, font, fontName, null, getSampleCount());
+ pmv.glPopMatrix();
+ }
+
+ dx = 10f;
+ dy += -fontNameBox.getHeight() * pixelSizeFName - 10f;
+
+ if(null != headtext) {
+ pmv.glPushMatrix();
+ // System.err.printf("Head: [%f %f] -> [%f %f]%n", dx, dy, nearPlaneX0+(dx*nearPlaneSx), nearPlaneY0+(dy*nearPlaneSy));
+ pmv.glTranslatef(nearPlaneX0+(dx*nearPlaneSx), nearPlaneY0+(dy*nearPlaneSy), nearPlaneZ0);
+ {
+ final float sxy = nearPlaneS * pixelSizeHead;
+ pmv.glScalef(sxy, sxy, 1.0f);
+ }
+ // pmv.glTranslatef(x0, y1, z0);
+ textRegionUtil.drawString3D(gl, renderer, font, headtext, null, getSampleCount());
+ pmv.glPopMatrix();
+ }
+
+ dy += ( -headbox.getHeight() - font.getLineHeight() ) * pixelSizeCenter;
+
+ {
+ pmv.glPushMatrix();
+ pmv.glTranslatef(nearPlaneX0+(dx*nearPlaneSx), nearPlaneY0+(dy*nearPlaneSy), nearPlaneZ0);
+ // System.err.printf("Bottom: [%f %f] -> [%f %f]%n", dx, dy, nearPlaneX0+(dx*nearPlaneSx), nearPlaneY0+(dy*nearPlaneSy));
+ pmv.glTranslatef(getXTran(), getYTran(), getZTran());
+ pmv.glRotatef(getAngle(), 0, 1, 0);
+ {
+ final float sxy = nearPlaneS * pixelSizeCenter;
+ pmv.glScalef(sxy, sxy, 1.0f);
+ }
+ rs.setColorStatic(0.9f, 0.0f, 0.0f, 1.0f);
+
+ if( bottomTextUseFrustum ) {
+ regionBottom.setFrustum(pmv.glGetFrustum());
+ }
+ if(!userInput) {
+ if( bottomTextUseFrustum ) {
+ TextRegionUtil.drawString3D(gl, regionBottom.clear(gl), renderer, font, text2, null, getSampleCount(), tempT1, tempT2);
+ } else {
+ textRegionUtil.drawString3D(gl, renderer, font, text2, null, getSampleCount());
+ }
+ } else {
+ if( bottomTextUseFrustum ) {
+ TextRegionUtil.drawString3D(gl, regionBottom.clear(gl), renderer, font, userString.toString(), null, getSampleCount(), tempT1, tempT2);
+ } else {
+ textRegionUtil.drawString3D(gl, renderer, font, userString.toString(), null, getSampleCount());
+ }
+ }
+ pmv.glPopMatrix();
+ }
+ renderer.enable(gl, false);
+ }
+ final boolean bottomTextUseFrustum = true;
+
+ public Font getFont() { return font; }
+ public float getFontSizeHead() { return fontSizeHead; }
+
+ public void fontBottomIncr(final int v) {
+ fontSizeCenter = Math.abs((fontSizeCenter + v) % fontSizeModulo) ;
+ dumpMatrix(true);
+ }
+
+ public void fontHeadIncr(final int v) {
+ fontSizeHead = Math.abs((fontSizeHead + v) % fontSizeModulo) ;
+ updateFontNameBox();
+ if(null != headtext) {
+ headbox = font.getMetricBounds(headtext);
+ }
+ }
+
+ public void setFontHeadSize(final int v) {
+ if( 0 < v ) {
+ fontSizeHead = v % fontSizeModulo;
+ updateFontNameBox();
+ if(null != headtext) {
+ headbox = font.getMetricBounds(headtext);
+ }
+ }
+ }
+
+ public boolean nextFontSet() {
+ try {
+ final int set = ( fontSet == FontFactory.UBUNTU ) ? FontFactory.JAVA : FontFactory.UBUNTU ;
+ final Font _font = FontFactory.get(set).getDefault();
+ if(null != _font) {
+ fontSet = set;
+ font = _font;
+ updateFontNameBox();
+ return true;
+ }
+ } catch (final IOException ex) {
+ System.err.println("Caught: "+ex.getMessage());
+ }
+ return false;
+ }
+
+ public boolean setFontSet(final int set, final int family, final int stylebits) {
+ try {
+ final Font _font = FontFactory.get(set).get(family, stylebits);
+ if(null != _font) {
+ fontSet = set;
+ font = _font;
+ updateFontNameBox();
+ return true;
+ }
+ } catch (final IOException ex) {
+ System.err.println("Caught: "+ex.getMessage());
+ }
+ return false;
+ }
+
+ public boolean setFont(final Font _font) {
+ if(null != _font) {
+ // fontSet = ???
+ font = _font;
+ updateFontNameBox();
+ return true;
+ }
+ return false;
+ }
+
+ private void updateFontNameBox() {
+ fontName = font.getFullFamilyName()+" (head "+fontSizeHead+"pt)";
+ fontNameBox = font.getMetricBounds(fontName);
+ }
+
+ public boolean isUserInputMode() { return userInput; }
+
+ void dumpMatrix(final boolean bbox) {
+ System.err.println("Matrix: " + getXTran() + "/" + getYTran() + " x"+getZTran() + " @"+getAngle() +" fontSize "+fontSizeCenter);
+ if(bbox) {
+ System.err.println("bbox em: "+font.getMetricBounds(text2));
+ System.err.println("bbox px: "+font.getMetricBounds(text2).scale(nearPlaneS * FontScale.toPixels(fontSizeCenter, dpiV), new float[3]));
+ }
+ }
+
+ KeyAction keyAction = null;
+
+ @Override
+ public void attachInputListenerTo(final GLWindow window) {
+ if ( null == keyAction ) {
+ keyAction = new KeyAction();
+ window.addKeyListener(keyAction);
+ super.attachInputListenerTo(window);
+ }
+ }
+
+ @Override
+ public void detachInputListenerFrom(final GLWindow window) {
+ super.detachInputListenerFrom(window);
+ if ( null == keyAction ) {
+ return;
+ }
+ window.removeKeyListener(keyAction);
+ }
+
+ @Override
+ public void printScreen(final GLAutoDrawable drawable, final String dir, final String tech, final String objName, final boolean exportAlpha) throws GLException, IOException {
+ final String fn = font.getFullFamilyName().replace(' ', '_').replace('-', '_');
+ final String modes = Region.getRenderModeString(getRenderModes());
+ final String fsaa = "fsaa"+drawable.getChosenGLCapabilities().getNumSamples();
+ super.printScreen(drawable, dir, tech+"-"+modes, fsaa+"-"+fn+"-text"+getHeadBoxType()+"-"+objName, exportAlpha);
+ }
+
+ float fontHeadScale = 1f;
+
+ public class KeyAction implements KeyListener {
+ @Override
+ public void keyPressed(final KeyEvent e) {
+ if(userInput) {
+ return;
+ }
+ final short s = e.getKeySymbol();
+ if(s == KeyEvent.VK_3) {
+ if( e.isAltDown() ) {
+ fontHeadIncr(1);
+ } else {
+ fontBottomIncr(1);
+ }
+ }
+ else if(s == KeyEvent.VK_4) {
+ if( e.isAltDown() ) {
+ fontHeadIncr(-1);
+ } else {
+ fontBottomIncr(-1);
+ }
+ }
+ else if(s == KeyEvent.VK_H) {
+ switchHeadBox();
+ }
+ else if(s == KeyEvent.VK_F) {
+ drawFPS = !drawFPS;
+ }
+ else if(s == KeyEvent.VK_SPACE) {
+ nextFontSet();
+ }
+ else if(s == KeyEvent.VK_I) {
+ userInput = true;
+ setIgnoreInput(true);
+ }
+ }
+
+ @Override
+ public void keyReleased(final KeyEvent e) {
+ if( !e.isPrintableKey() || e.isAutoRepeat() ) {
+ return;
+ }
+ if(userInput) {
+ final short k = e.getKeySymbol();
+ if( KeyEvent.VK_ENTER == k ) {
+ userInput = false;
+ setIgnoreInput(false);
+ } else if( KeyEvent.VK_BACK_SPACE == k && userString.length()>0) {
+ userString.deleteCharAt(userString.length()-1);
+ } else {
+ final char c = e.getKeyChar();
+ if( font.isPrintableChar( c ) ) {
+ userString.append(c);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/MSAATool.java b/src/test/com/jogamp/opengl/test/junit/graph/MSAATool.java
new file mode 100644
index 000000000..bd18214dc
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/MSAATool.java
@@ -0,0 +1,96 @@
+/**
+ * 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.
+ */
+package com.jogamp.opengl.test.junit.graph;
+
+import com.jogamp.opengl.GL;
+import com.jogamp.opengl.GL2ES2;
+import com.jogamp.opengl.GL2GL3;
+import com.jogamp.opengl.GLAutoDrawable;
+import com.jogamp.opengl.GLCapabilitiesImmutable;
+
+public class MSAATool {
+ public static boolean glIsEnabled(final GL gl, final int name) {
+ boolean isEnabled = false;
+ try {
+ isEnabled = gl.glIsEnabled(name);
+ final int glerr = gl.glGetError();
+ if(GL.GL_NO_ERROR != glerr) {
+ System.err.println("glIsEnabled(0x"+Integer.toHexString(name)+") -> error 0x"+Integer.toHexString(glerr));
+ }
+ } catch (final Exception e) {
+ System.err.println("Caught exception: "+e.getMessage());
+ // e.printStackTrace();
+ }
+ return isEnabled;
+ }
+ public static void dump(final GLAutoDrawable drawable) {
+ final float[] vf = new float[] { 0f };
+ final byte[] vb = new byte[] { 0 };
+ final int[] vi = new int[] { 0, 0 };
+
+ System.out.println("GL MSAA SETUP:");
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GLCapabilitiesImmutable caps = drawable.getChosenGLCapabilities();
+ System.out.println(" Caps realised "+caps);
+ System.out.println(" Caps sample buffers "+caps.getSampleBuffers()+", samples "+caps.getNumSamples());
+
+ System.out.println(" GL MULTISAMPLE "+glIsEnabled(gl, GL.GL_MULTISAMPLE));
+ // sample buffers min 0, same as GLX_SAMPLE_BUFFERS_ARB or WGL_SAMPLE_BUFFERS_ARB
+ gl.glGetIntegerv(GL.GL_SAMPLE_BUFFERS, vi, 0);
+ // samples min 0
+ gl.glGetIntegerv(GL.GL_SAMPLES, vi, 1);
+ System.out.println(" GL SAMPLE_BUFFERS "+vi[0]+", SAMPLES "+vi[1]);
+
+ System.out.println("GL CSAA SETUP:");
+ // default FALSE
+ System.out.println(" GL SAMPLE COVERAGE "+glIsEnabled(gl, GL.GL_SAMPLE_COVERAGE));
+ // default FALSE
+ System.out.println(" GL SAMPLE_ALPHA_TO_COVERAGE "+glIsEnabled(gl, GL.GL_SAMPLE_ALPHA_TO_COVERAGE));
+ // default FALSE
+ System.out.println(" GL SAMPLE_ALPHA_TO_ONE "+glIsEnabled(gl, GL.GL_SAMPLE_ALPHA_TO_ONE));
+ // default FALSE, value 1, invert false
+ gl.glGetFloatv(GL.GL_SAMPLE_COVERAGE_VALUE, vf, 0);
+ gl.glGetBooleanv(GL.GL_SAMPLE_COVERAGE_INVERT, vb, 0);
+ System.out.println(" GL SAMPLE_COVERAGE "+glIsEnabled(gl, GL.GL_SAMPLE_COVERAGE) +
+ ": SAMPLE_COVERAGE_VALUE "+vf[0]+
+ ", SAMPLE_COVERAGE_INVERT "+vb[0]);
+ dumpBlend(gl);
+ }
+ public static void dumpBlend(final GL gl) {
+ final int[] vi = new int[] { 0, 0, 0, 0 };
+ gl.glGetIntegerv(GL.GL_BLEND, vi, 0);
+ gl.glGetIntegerv(GL.GL_BLEND_SRC_ALPHA, vi, 1);
+ gl.glGetIntegerv(GL.GL_BLEND_SRC_RGB, vi, 2);
+ gl.glGetIntegerv(GL.GL_BLEND_DST_RGB, vi, 3);
+ final boolean blendEnabled = vi[0] == GL.GL_TRUE;
+ System.out.println("GL_BLEND "+blendEnabled+"/"+glIsEnabled(gl, GL.GL_BLEND) +
+ " GL_SRC_ALPHA 0x"+Integer.toHexString(vi[1])+
+ " GL_SRC_RGB 0x"+Integer.toHexString(vi[2])+
+ " GL_DST_RGB 0x"+Integer.toHexString(vi[3]));
+ }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java b/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java
index b7aff2f79..3ffd22fd0 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java
@@ -48,9 +48,6 @@ import com.jogamp.graph.curve.Region;
import com.jogamp.graph.curve.opengl.RenderState;
import com.jogamp.graph.geom.SVertex;
import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.test.junit.graph.demos.GPURegionGLListener01;
-import com.jogamp.opengl.test.junit.graph.demos.GPURegionGLListener10;
-import com.jogamp.opengl.test.junit.graph.demos.GPURendererListenerBase01;
import com.jogamp.opengl.test.junit.util.UITestCase;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT20.java b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT20.java
index 624b1ff94..562688bdc 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT20.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT20.java
@@ -53,8 +53,6 @@ import com.jogamp.graph.font.Font;
import com.jogamp.graph.font.FontFactory;
import com.jogamp.graph.geom.SVertex;
import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.test.junit.graph.demos.GPUTextRendererListenerBase01;
-import com.jogamp.opengl.test.junit.graph.demos.MSAATool;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.util.caps.NonFSAAGLCapsChooser;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/GPUUISceneNewtCanvasAWTDemo.java b/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/GPUUISceneNewtCanvasAWTDemo.java
deleted file mode 100644
index c279079b7..000000000
--- a/src/test/com/jogamp/opengl/test/junit/graph/ui/demos/GPUUISceneNewtCanvasAWTDemo.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/**
- * Copyright 2010-2023 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.
- */
-package com.jogamp.opengl.test.junit.graph.ui.demos;
-
-import java.awt.Component;
-import java.awt.Frame;
-import java.lang.reflect.InvocationTargetException;
-
-import com.jogamp.nativewindow.ScalableSurface;
-import com.jogamp.nativewindow.util.Dimension;
-import com.jogamp.nativewindow.util.DimensionImmutable;
-import com.jogamp.opengl.GLCapabilities;
-import com.jogamp.opengl.GLProfile;
-import javax.swing.SwingUtilities;
-
-import org.junit.Assume;
-
-import com.jogamp.graph.curve.Region;
-import com.jogamp.newt.awt.NewtCanvasAWT;
-import com.jogamp.newt.event.WindowAdapter;
-import com.jogamp.newt.event.WindowEvent;
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.test.junit.util.MiscUtils;
-import com.jogamp.opengl.util.Animator;
-
-public class GPUUISceneNewtCanvasAWTDemo {
- static final boolean DEBUG = false;
- static final boolean TRACE = false;
-
- static void setComponentSize(final Component comp, final DimensionImmutable new_sz) {
- try {
- javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
- @Override
- public void run() {
- final java.awt.Dimension d = new java.awt.Dimension(new_sz.getWidth(), new_sz.getHeight());
- comp.setMinimumSize(d);
- comp.setPreferredSize(d);
- comp.setSize(d);
- } } );
- } catch( final Throwable throwable ) {
- throwable.printStackTrace();
- Assume.assumeNoException( throwable );
- }
- }
-
- public static void main(final String[] args) throws InterruptedException, InvocationTargetException {
- String fontfilename = null;
-
- int SceneMSAASamples = 0;
- boolean GraphVBAAMode = false;
- boolean GraphMSAAMode = false;
- float GraphAutoMode = GPUUISceneGLListener0A.DefaultNoAADPIThreshold;
-
- final float[] reqSurfacePixelScale = new float[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
-
- int width = 800, height = 400;
- int x = 10, y = 10;
-
- boolean forceES2 = false;
- boolean forceES3 = false;
- boolean forceGL3 = false;
- boolean forceGLDef = false;
-
- if( 0 != args.length ) {
- for(int i=0; i<args.length; i++) {
- if(args[i].equals("-smsaa")) {
- i++;
- SceneMSAASamples = MiscUtils.atoi(args[i], SceneMSAASamples);
- GraphMSAAMode = false;
- GraphVBAAMode = false;
- GraphAutoMode = 0f;
- } else if(args[i].equals("-gmsaa")) {
- GraphMSAAMode = true;
- GraphVBAAMode = false;
- GraphAutoMode = 0f;
- } else if(args[i].equals("-gvbaa")) {
- GraphMSAAMode = false;
- GraphVBAAMode = true;
- GraphAutoMode = 0f;
- } else if(args[i].equals("-gauto")) {
- GraphMSAAMode = false;
- GraphVBAAMode = true;
- i++;
- GraphAutoMode = MiscUtils.atof(args[i], GraphAutoMode);
- } else if(args[i].equals("-font")) {
- i++;
- fontfilename = args[i];
- } else if(args[i].equals("-width")) {
- i++;
- width = MiscUtils.atoi(args[i], width);
- } else if(args[i].equals("-height")) {
- i++;
- height = MiscUtils.atoi(args[i], height);
- } else if(args[i].equals("-x")) {
- i++;
- x = MiscUtils.atoi(args[i], x);
- } else if(args[i].equals("-y")) {
- i++;
- y = MiscUtils.atoi(args[i], y);
- } else if(args[i].equals("-pixelScale")) {
- i++;
- final float pS = MiscUtils.atof(args[i], reqSurfacePixelScale[0]);
- reqSurfacePixelScale[0] = pS;
- reqSurfacePixelScale[1] = pS;
- } else if(args[i].equals("-es2")) {
- forceES2 = true;
- } else if(args[i].equals("-es3")) {
- forceES3 = true;
- } else if(args[i].equals("-gl3")) {
- forceGL3 = true;
- } else if(args[i].equals("-gldef")) {
- forceGLDef = true;
- }
- }
- }
- System.err.println("forceES2 "+forceES2);
- System.err.println("forceES3 "+forceES3);
- System.err.println("forceGL3 "+forceGL3);
- System.err.println("forceGLDef "+forceGLDef);
- System.err.println("Desired win size "+width+"x"+height);
- System.err.println("Desired win pos "+x+"/"+y);
- System.err.println("Scene MSAA Samples "+SceneMSAASamples);
- System.err.println("Graph MSAA Mode "+GraphMSAAMode);
- System.err.println("Graph VBAA Mode "+GraphVBAAMode);
- System.err.println("Graph Auto Mode "+GraphAutoMode+" no-AA dpi threshold");
-
- final GLProfile glp;
- if(forceGLDef) {
- glp = GLProfile.getDefault();
- } else if(forceGL3) {
- glp = GLProfile.get(GLProfile.GL3);
- } else if(forceES3) {
- glp = GLProfile.get(GLProfile.GLES3);
- } else if(forceES2) {
- glp = GLProfile.get(GLProfile.GLES2);
- } else {
- glp = GLProfile.getGL2ES2();
- }
- System.err.println("GLProfile: "+glp);
- final GLCapabilities caps = new GLCapabilities(glp);
- caps.setAlphaBits(4);
- if( SceneMSAASamples > 0 ) {
- caps.setSampleBuffers(true);
- caps.setNumSamples(SceneMSAASamples);
- }
- System.out.println("Requested: " + caps);
-
- final int rmode;
- if( GraphVBAAMode ) {
- rmode = Region.VBAA_RENDERING_BIT;
- } else if( GraphMSAAMode ) {
- rmode = Region.MSAA_RENDERING_BIT;
- } else {
- rmode = 0;
- }
-
- final GLWindow window = GLWindow.create(caps);
- window.setPosition(x, y);
- window.setSize(width, height);
- window.setTitle("GraphUI Newt/AWT Demo: graph["+Region.getRenderModeString(rmode)+"], msaa "+SceneMSAASamples);
- window.setSurfaceScale(reqSurfacePixelScale);
- final float[] valReqSurfacePixelScale = window.getRequestedSurfaceScale(new float[2]);
-
- final GPUUISceneGLListener0A sceneGLListener = 0 < GraphAutoMode ? new GPUUISceneGLListener0A(fontfilename, GraphAutoMode, DEBUG, TRACE) :
- new GPUUISceneGLListener0A(fontfilename, rmode, DEBUG, TRACE);
-
- window.addGLEventListener(sceneGLListener);
- sceneGLListener.attachInputListenerTo(window);
-
- final Animator animator = new Animator();
- animator.setUpdateFPSFrames(60, System.err);
- animator.add(window);
-
- window.addWindowListener(new WindowAdapter() {
- @Override
- public void windowDestroyed(final WindowEvent e) {
- animator.stop();
- }
- });
-
- final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(window);
- final Frame frame = new Frame("GraphUI Newt/AWT Demo: graph["+Region.getRenderModeString(rmode)+"], msaa "+SceneMSAASamples);
-
- setComponentSize(newtCanvasAWT, new Dimension(width, height));
- frame.add(newtCanvasAWT);
- SwingUtilities.invokeAndWait(new Runnable() {
- @Override
- public void run() {
- frame.pack();
- frame.setVisible(true);
- }
- });
- animator.start();
- }
-}