summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/android/com/jogamp/android/launcher/NEWTLauncherGraphUI1pActivity.java (renamed from src/android/com/jogamp/android/launcher/NEWTLauncherGraphUIActivity.java)4
-rw-r--r--src/android/com/jogamp/android/launcher/NEWTLauncherGraphUI2pActivity.java15
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java7
-rwxr-xr-xsrc/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java11
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/shader/consts.glsl8
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-xxx.fp47
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01b-xxx.fp99
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02a-es2.fp (renamed from src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02-es2.fp)2
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02a-gl2.fp (renamed from src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02-gl2.fp)2
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02a-xxx.fp48
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02b-es2.fp14
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02b-gl2.fp6
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02b-xxx.fp (renamed from src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02-xxx.fp)61
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/shader/uniforms.glsl2
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivity.java (renamed from src/test/com/jogamp/opengl/test/android/NEWTGraphUIActivity.java)4
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivity.java77
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java47
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo01.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo02.java50
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RIButton.java9
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java19
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java5
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java2
24 files changed, 386 insertions, 159 deletions
diff --git a/src/android/com/jogamp/android/launcher/NEWTLauncherGraphUIActivity.java b/src/android/com/jogamp/android/launcher/NEWTLauncherGraphUI1pActivity.java
index 6a185fecc..1af0de1f2 100644
--- a/src/android/com/jogamp/android/launcher/NEWTLauncherGraphUIActivity.java
+++ b/src/android/com/jogamp/android/launcher/NEWTLauncherGraphUI1pActivity.java
@@ -1,7 +1,7 @@
package com.jogamp.android.launcher;
-public class NEWTLauncherGraphUIActivity extends NEWTLauncherActivity {
- static String demo = "com.jogamp.opengl.test.android.NEWTGraphUIActivity";
+public class NEWTLauncherGraphUI1pActivity extends NEWTLauncherActivity {
+ static String demo = "com.jogamp.opengl.test.android.NEWTGraphUI1pActivity";
static String pkg = "com.jogamp.opengl.test";
@Override
diff --git a/src/android/com/jogamp/android/launcher/NEWTLauncherGraphUI2pActivity.java b/src/android/com/jogamp/android/launcher/NEWTLauncherGraphUI2pActivity.java
new file mode 100644
index 000000000..0a5f8d265
--- /dev/null
+++ b/src/android/com/jogamp/android/launcher/NEWTLauncherGraphUI2pActivity.java
@@ -0,0 +1,15 @@
+package com.jogamp.android.launcher;
+
+public class NEWTLauncherGraphUI2pActivity extends NEWTLauncherActivity {
+ static String demo = "com.jogamp.opengl.test.android.NEWTGraphUI2pActivity";
+ static String pkg = "com.jogamp.opengl.test";
+
+ @Override
+ public String getUserActivityName() {
+ return demo;
+ }
+ @Override
+ public String getUserPackageName() {
+ return pkg;
+ }
+}
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java
index 0a9e865cb..3c23733a5 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java
@@ -265,11 +265,10 @@ public abstract class Renderer {
return "curverenderer01" + getShaderGLVersionSuffix(gl);
}
- /**
- * FIXME: 2nd pass shader !
- */
protected String getFragmentShaderName(GL2ES2 gl) {
- return "curverenderer01a" + getShaderGLVersionSuffix(gl);
+ final String type = "01" ; // Region.isNonUniformWeight(renderModes) ? "02" : "01" ;
+ final String pass = Region.isVBAA(renderModes) ? "b" : "a" ;
+ return "curverenderer" + type + pass + getShaderGLVersionSuffix(gl);
}
protected String getShaderGLVersionSuffix(GL2ES2 gl) {
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java b/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
index 0218c729a..0217a6369 100755
--- a/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
@@ -46,16 +46,11 @@ public class RegionRendererImpl01 extends RegionRenderer {
}
- /**
- * FIXME: 2nd pass shader !
- */
@Override
protected String getFragmentShaderName(GL2ES2 gl) {
- if(Region.isNonUniformWeight(renderModes)){
- // FIXME: split shader !
- return "curverenderer02" + getShaderGLVersionSuffix(gl);
- }
- return "curverenderer01a" + getShaderGLVersionSuffix(gl);
+ final String type = Region.isNonUniformWeight(renderModes) ? "02" : "01" ;
+ final String pass = Region.isVBAA(renderModes) ? "b" : "a" ;
+ return "curverenderer" + type + pass + getShaderGLVersionSuffix(gl);
}
protected boolean initShaderProgram(GL2ES2 gl) {
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/consts.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/consts.glsl
deleted file mode 100644
index 58c4fe50c..000000000
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/consts.glsl
+++ /dev/null
@@ -1,8 +0,0 @@
-
-#ifndef consts_glsl
-#define consts_glsl
-
-const int MAX_TEXTURE_UNITS = 8; // <= gl_MaxTextureImageUnits
-// const int MAX_LIGHTS = 8;
-
-#endif // consts_glsl
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-xxx.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-xxx.fp
index b51ec5808..f3a88adef 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-xxx.fp
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01a-xxx.fp
@@ -1,51 +1,40 @@
//Copyright 2010 JogAmp Community. All rights reserved.
+//
+// 1-pass shader w/o weight
+//
+
#include uniforms.glsl
#include varyings.glsl
-const vec3 b_color = vec3(1.0, 1.0, 1.0);
-const vec4 tex_weights = vec4(0.075, 0.06, 0.045, 0.025);
-
void main (void)
{
vec2 rtex = vec2(abs(gcv_TexCoord.x),abs(gcv_TexCoord.y));
vec3 c = gcu_ColorStatic.rgb;
float alpha = 0.0;
- float enable = 1.0;
if((gcv_TexCoord.x == 0.0) && (gcv_TexCoord.y == 0.0)) {
alpha = gcu_Alpha;
}
else if ((gcv_TexCoord.x > 0.0) && (rtex.y > 0.0 || rtex.x == 1.0)) {
- vec2 dtx = dFdx(rtex);
- vec2 dty = dFdy(rtex);
-
rtex.y -= 0.1;
- if(rtex.y < 0.0) {
- if(gcv_TexCoord.y < 0.0) {
- // discard; // freezes NV tegra2 compiler (TODO: dbl check)
- enable = 0.0;
- } else {
- rtex.y = 0.0;
- }
- }
-
- vec2 f = vec2((dtx.y - dtx.x + 2.0*rtex.x*dtx.x), (dty.y - dty.x + 2.0*rtex.x*dty.x));
- float position = rtex.y - (rtex.x * (1.0 - rtex.x));
- float d = position/(length(f));
-
- float a = (0.5 - d * sign(gcv_TexCoord.y));
-
- if (a >= 1.0) {
- alpha = gcu_Alpha * enable;
- } else if (a <= 0.0) {
- // discard; // freezes NV tegra2 compiler (TODO: dbl check)
+ if(rtex.y < 0.0 && gcv_TexCoord.y < 0.0) {
+ // discard; // freezes NV tegra2 compiler
alpha = 0.0;
- } else {
- alpha = gcu_Alpha * a * enable;
- // ?? mix(b_color,gcu_ColorStatic.rgb, a);
+ } else {
+ rtex.y = max(rtex.y, 0.0);
+
+ vec2 dtx = dFdx(rtex);
+ vec2 dty = dFdy(rtex);
+
+ vec2 f = vec2((dtx.y - dtx.x + 2.0*rtex.x*dtx.x), (dty.y - dty.x + 2.0*rtex.x*dty.x));
+ float position = rtex.y - (rtex.x * (1.0 - rtex.x));
+
+ // FIXME: will we ever set gcu_Alpha != 1.0 ? If not, a==alpha!
+ float a = clamp(0.5 - ( position/length(f) ) * sign(gcv_TexCoord.y), 0.0, 1.0);
+ alpha = gcu_Alpha * a;
}
}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01b-xxx.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01b-xxx.fp
index 4bef33dbe..879e41e4c 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01b-xxx.fp
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01b-xxx.fp
@@ -1,10 +1,12 @@
//Copyright 2010 JogAmp Community. All rights reserved.
+//
+// 2-pass shader w/o weight
+//
+
#include uniforms.glsl
#include varyings.glsl
-#include consts.glsl
-const vec3 b_color = vec3(1.0, 1.0, 1.0);
const vec4 tex_weights = vec4(0.075, 0.06, 0.045, 0.025);
void main (void)
@@ -13,41 +15,68 @@ void main (void)
vec3 c = gcu_ColorStatic.rgb;
float alpha = 0.0;
+ float enable = 1.0;
- vec2 dfx = dFdx(gcv_TexCoord);
- vec2 dfy = dFdy(gcv_TexCoord);
-
- vec2 size = 1.0/gcu_TextureSize;
+ if((gcv_TexCoord.x == 0.0) && (gcv_TexCoord.y == 0.0)) {
+ alpha = gcu_Alpha;
+ }
+ else if((gcv_TexCoord.x >= 5.0)) {
+ vec2 dfx = dFdx(gcv_TexCoord);
+ vec2 dfy = dFdy(gcv_TexCoord);
+
+ vec2 size = 1.0/gcu_TextureSize;
- rtex -= 5.0;
- vec4 t = texture2D(gcu_TextureUnit, rtex)* 0.18;
+ rtex -= 5.0;
+ vec4 t = texture2D(gcu_TextureUnit, rtex)* 0.18;
+
+ t += texture2D(gcu_TextureUnit, rtex + size*(vec2(1, 0)))*tex_weights.x;
+ t += texture2D(gcu_TextureUnit, rtex - size*(vec2(1, 0)))*tex_weights.x;
+ t += texture2D(gcu_TextureUnit, rtex + size*(vec2(0, 1)))*tex_weights.x;
+ t += texture2D(gcu_TextureUnit, rtex - size*(vec2(0, 1)))*tex_weights.x;
+
+ t += texture2D(gcu_TextureUnit, rtex + 2.0*size*(vec2(1, 0)))*tex_weights.y;
+ t += texture2D(gcu_TextureUnit, rtex - 2.0*size*(vec2(1, 0)))*tex_weights.y;
+ t += texture2D(gcu_TextureUnit, rtex + 2.0*size*(vec2(0, 1)))*tex_weights.y;
+ t += texture2D(gcu_TextureUnit, rtex - 2.0*size*(vec2(0, 1)))*tex_weights.y;
+
+ t += texture2D(gcu_TextureUnit, rtex + 3.0*size*(vec2(1, 0)))*tex_weights.z;
+ t += texture2D(gcu_TextureUnit, rtex - 3.0*size*(vec2(1, 0)))*tex_weights.z;
+ t += texture2D(gcu_TextureUnit, rtex + 3.0*size*(vec2(0, 1)))*tex_weights.z;
+ t += texture2D(gcu_TextureUnit, rtex - 3.0*size*(vec2(0, 1)))*tex_weights.z;
+
+ t += texture2D(gcu_TextureUnit, rtex + 4.0*size*(vec2(1, 0)))*tex_weights.w;
+ t += texture2D(gcu_TextureUnit, rtex - 4.0*size*(vec2(1, 0)))*tex_weights.w;
+ t += texture2D(gcu_TextureUnit, rtex + 4.0*size*(vec2(0, 1)))*tex_weights.w;
+ t += texture2D(gcu_TextureUnit, rtex - 4.0*size*(vec2(0, 1)))*tex_weights.w;
+
+ /** discard freezes NV tegra2 compiler
+ if(t.w == 0.0){
+ discard;
+ } */
+
+ c = t.xyz;
+ alpha = gcu_Alpha * t.w;
+ }
+ else if ((gcv_TexCoord.x > 0.0) && (rtex.y > 0.0 || rtex.x == 1.0)) {
+ rtex.y -= 0.1;
+
+ if(rtex.y < 0.0 && gcv_TexCoord.y < 0.0) {
+ // discard; // freezes NV tegra2 compiler
+ alpha = 0.0;
+ } else {
+ rtex.y = max(rtex.y, 0.0);
+
+ vec2 dtx = dFdx(rtex);
+ vec2 dty = dFdy(rtex);
+
+ vec2 f = vec2((dtx.y - dtx.x + 2.0*rtex.x*dtx.x), (dty.y - dty.x + 2.0*rtex.x*dty.x));
+ float position = rtex.y - (rtex.x * (1.0 - rtex.x));
+
+ // FIXME: will we ever set gcu_Alpha != 1.0 ? If not, a==alpha!
+ float a = clamp(0.5 - ( position/length(f) ) * sign(gcv_TexCoord.y), 0.0, 1.0);
+ alpha = gcu_Alpha * a;
+ }
+ }
- t += texture2D(gcu_TextureUnit, rtex + size*(vec2(1, 0)))*tex_weights.x;
- t += texture2D(gcu_TextureUnit, rtex - size*(vec2(1, 0)))*tex_weights.x;
- t += texture2D(gcu_TextureUnit, rtex + size*(vec2(0, 1)))*tex_weights.x;
- t += texture2D(gcu_TextureUnit, rtex - size*(vec2(0, 1)))*tex_weights.x;
-
- t += texture2D(gcu_TextureUnit, rtex + 2.0*size*(vec2(1, 0)))*tex_weights.y;
- t += texture2D(gcu_TextureUnit, rtex - 2.0*size*(vec2(1, 0)))*tex_weights.y;
- t += texture2D(gcu_TextureUnit, rtex + 2.0*size*(vec2(0, 1)))*tex_weights.y;
- t += texture2D(gcu_TextureUnit, rtex - 2.0*size*(vec2(0, 1)))*tex_weights.y;
-
- t += texture2D(gcu_TextureUnit, rtex + 3.0*size*(vec2(1, 0)))*tex_weights.z;
- t += texture2D(gcu_TextureUnit, rtex - 3.0*size*(vec2(1, 0)))*tex_weights.z;
- t += texture2D(gcu_TextureUnit, rtex + 3.0*size*(vec2(0, 1)))*tex_weights.z;
- t += texture2D(gcu_TextureUnit, rtex - 3.0*size*(vec2(0, 1)))*tex_weights.z;
-
- t += texture2D(gcu_TextureUnit, rtex + 4.0*size*(vec2(1, 0)))*tex_weights.w;
- t += texture2D(gcu_TextureUnit, rtex - 4.0*size*(vec2(1, 0)))*tex_weights.w;
- t += texture2D(gcu_TextureUnit, rtex + 4.0*size*(vec2(0, 1)))*tex_weights.w;
- t += texture2D(gcu_TextureUnit, rtex - 4.0*size*(vec2(0, 1)))*tex_weights.w;
-
- /** discard freezes NV tegra2 compiler (TODO: dbl check)
- if(t.w == 0.0){
- discard;
- } */
-
- c = t.xyz;
- alpha = gcu_Alpha * t.w;
gl_FragColor = vec4(c, alpha);
}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02-es2.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02a-es2.fp
index 9a2128765..b52420350 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02-es2.fp
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02a-es2.fp
@@ -10,5 +10,5 @@ precision mediump float;
precision mediump int;
precision mediump sampler2D;
-#include curverenderer02-xxx.fp
+#include curverenderer02a-xxx.fp
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02-gl2.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02a-gl2.fp
index d7fe31a08..01715daa5 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02-gl2.fp
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02a-gl2.fp
@@ -2,5 +2,5 @@
#version 110
-#include curverenderer02-xxx.fp
+#include curverenderer02a-xxx.fp
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02a-xxx.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02a-xxx.fp
new file mode 100644
index 000000000..d31bafb5a
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02a-xxx.fp
@@ -0,0 +1,48 @@
+//Copyright 2010 JogAmp Community. All rights reserved.
+
+//
+// 1-pass shader w/ weight
+//
+
+#include uniforms.glsl
+#include varyings.glsl
+
+void main (void)
+{
+ vec2 rtex = vec2(abs(gcv_TexCoord.x),abs(gcv_TexCoord.y));
+ vec3 c = gcu_ColorStatic.rgb;
+
+ float alpha = 0.0;
+
+ if((gcv_TexCoord.x == 0.0) && (gcv_TexCoord.y == 0.0)) {
+ alpha = gcu_Alpha;
+ }
+ else if ((gcv_TexCoord.x > 0.0) && (rtex.y > 0.0 || rtex.x == 1.0)) {
+ rtex.y -= 0.1;
+
+ if(rtex.y < 0.0 && gcv_TexCoord.y < 0.0) {
+ // discard; // freezes NV tegra2 compiler
+ alpha = 0.0;
+ } else {
+ rtex.y = max(rtex.y, 0.0);
+
+ vec2 dtx = dFdx(rtex);
+ vec2 dty = dFdy(rtex);
+
+ float w = gcu_Weight;
+ float pd = ((2.0 - (2.0*w))*rtex.x*rtex.x) + 2.0*(w-1.0)*rtex.x + 1.0;
+ float position = rtex.y - ((w*rtex.x*(1.0 - rtex.x))/pd);
+
+ float aph = 2.0 - 2.0*w;
+
+ float gd = (aph*rtex.x*rtex.x + 2.0*rtex.x + 1.0)*(aph*rtex.x*rtex.x + 2.0*rtex.x + 1.0);
+ vec2 f = vec2((dtx.y - (w*dtx.x*(1.0 - 2.0*rtex.x))/gd), (dty.y - (w*dty.x*(1.0 - 2.0*rtex.x))/gd));
+
+ // FIXME: will we ever set gcu_Alpha != 1.0 ? If not, a==alpha!
+ float a = clamp(0.5 - ( position/length(f) ) * sign(gcv_TexCoord.y), 0.0, 1.0);
+ alpha = gcu_Alpha * a;
+ }
+ }
+
+ gl_FragColor = vec4(c, alpha);
+}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02b-es2.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02b-es2.fp
new file mode 100644
index 000000000..e0486dd7b
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02b-es2.fp
@@ -0,0 +1,14 @@
+//Copyright 2010 JogAmp Community. All rights reserved.
+
+#version 100
+
+// we require dFdx/dFdy
+// #extension OES_standard_derivatives : require
+#extension GL_OES_standard_derivatives : enable
+
+precision mediump float;
+precision mediump int;
+precision mediump sampler2D;
+
+#include curverenderer02b-xxx.fp
+
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02b-gl2.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02b-gl2.fp
new file mode 100644
index 000000000..b1cc72188
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02b-gl2.fp
@@ -0,0 +1,6 @@
+//Copyright 2010 JogAmp Community. All rights reserved.
+
+#version 110
+
+#include curverenderer02b-xxx.fp
+
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02-xxx.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02b-xxx.fp
index 4f66cb41e..be738498c 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02-xxx.fp
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer02b-xxx.fp
@@ -1,9 +1,12 @@
//Copyright 2010 JogAmp Community. All rights reserved.
+//
+// 2-pass shader w/ weight
+//
+
#include uniforms.glsl
#include varyings.glsl
-const vec3 b_color = vec3(0.0, 0.0, 0.0);
const vec4 tex_weights = vec4(0.075, 0.06, 0.045, 0.025);
void main (void)
@@ -20,12 +23,8 @@ void main (void)
vec2 dfx = dFdx(gcv_TexCoord);
vec2 dfy = dFdy(gcv_TexCoord);
- // vec2 size;
- //#if __VERSION__ < 130
- vec2 size = 1.0/gcu_TextureSize;
- //#else
- // size = 1.0/textureSize(gcu_TextureUnit,0);
- //#endif
+ vec2 size = 1.0/gcu_TextureSize;
+
rtex -= 5.0;
vec4 t = texture2D(gcu_TextureUnit, rtex)* 0.18;
@@ -49,9 +48,10 @@ void main (void)
t += texture2D(gcu_TextureUnit, rtex + 4.0*size*(vec2(0, 1)))*tex_weights.w;
t += texture2D(gcu_TextureUnit, rtex - 4.0*size*(vec2(0, 1)))*tex_weights.w;
+ /** discard freezes NV tegra2 compiler
if(t.w == 0.0) {
discard;
- }
+ } */
c = t.xyz;
alpha = gcu_Alpha * t.w;
@@ -60,34 +60,29 @@ void main (void)
else if ((gcv_TexCoord.x > 0.0) && (rtex.y > 0.0 || rtex.x == 1.0)) {
rtex.y -= 0.1;
- if(rtex.y < 0.0) {
- if(gcv_TexCoord.y < 0.0) {
- discard;
- } else {
- rtex.y = 0.0;
- }
- }
- vec2 dtx = dFdx(rtex);
- vec2 dty = dFdy(rtex);
-
- float w = gcu_Weight;
- float pd = ((2.0 - (2.0*w))*rtex.x*rtex.x) + 2.0*(w-1.0)*rtex.x + 1.0;
- float position = rtex.y - ((w*rtex.x*(1.0 - rtex.x))/pd);
+ if(rtex.y < 0.0 && gcv_TexCoord.y < 0.0) {
+ // discard; // freezes NV tegra2 compiler
+ alpha = 0.0;
+ } else {
+ rtex.y = max(rtex.y, 0.0);
- float aph = 2.0 - 2.0*w;
-
- float gd = (aph*rtex.x*rtex.x + 2.0*rtex.x + 1.0)*(aph*rtex.x*rtex.x + 2.0*rtex.x + 1.0);
- vec2 f = vec2((dtx.y - (w*dtx.x*(1.0 - 2.0*rtex.x))/gd), (dty.y - (w*dty.x*(1.0 - 2.0*rtex.x))/gd));
+ vec2 dtx = dFdx(rtex);
+ vec2 dty = dFdy(rtex);
+
+ float w = gcu_Weight;
+ float pd = ((2.0 - (2.0*w))*rtex.x*rtex.x) + 2.0*(w-1.0)*rtex.x + 1.0;
+ float position = rtex.y - ((w*rtex.x*(1.0 - rtex.x))/pd);
- float d = position/(length(f));
- float a = (0.5 - d * sign(gcv_TexCoord.y));
- if (a >= 1.0) {
- alpha = gcu_Alpha;
- } else if (a <= 0.0) {
- discard;
- } else {
- alpha = gcu_Alpha*a;
+ float aph = 2.0 - 2.0*w;
+
+ float gd = (aph*rtex.x*rtex.x + 2.0*rtex.x + 1.0)*(aph*rtex.x*rtex.x + 2.0*rtex.x + 1.0);
+ vec2 f = vec2((dtx.y - (w*dtx.x*(1.0 - 2.0*rtex.x))/gd), (dty.y - (w*dty.x*(1.0 - 2.0*rtex.x))/gd));
+
+ // FIXME: will we ever set gcu_Alpha != 1.0 ? If not, a==alpha!
+ float a = clamp(0.5 - ( position/length(f) ) * sign(gcv_TexCoord.y), 0.0, 1.0);
+ alpha = gcu_Alpha * a;
}
}
+
gl_FragColor = vec4(c, alpha);
}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/uniforms.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/uniforms.glsl
index 9d8ea75ea..5bbd5de14 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/uniforms.glsl
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/uniforms.glsl
@@ -12,6 +12,8 @@ uniform sampler2D gcu_TextureUnit;
uniform vec2 gcu_TextureSize;
// #endif
+// const int MAX_TEXTURE_UNITS = 8; // <= gl_MaxTextureImageUnits
+// const int MAX_LIGHTS = 8;
// uniform mat3 gcu_NormalMatrix; // transpose(inverse(ModelView)).3x3
// uniform int gcu_ColorEnabled;
// uniform int gcu_TexCoordEnabled[MAX_TEXTURE_UNITS];
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGraphUIActivity.java b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivity.java
index 3fcc82689..99de90f2a 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGraphUIActivity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivity.java
@@ -42,7 +42,7 @@ import com.jogamp.opengl.util.Animator;
import android.os.Bundle;
import android.util.Log;
-public class NEWTGraphUIActivity extends NewtBaseActivity {
+public class NEWTGraphUI1pActivity extends NewtBaseActivity {
static String TAG = "NEWTGraphUIActivity";
@Override
@@ -59,7 +59,7 @@ public class NEWTGraphUIActivity extends NewtBaseActivity {
GLWindow glWindow = GLWindow.create(caps);
setContentView(glWindow);
- glWindow.addGLEventListener(new GPUUISceneGLListener0A());
+ glWindow.addGLEventListener(new GPUUISceneGLListener0A(0));
glWindow.getWindow().getScreen().addScreenModeListener(new ScreenModeListener() {
public void screenModeChangeNotify(ScreenMode sm) { }
public void screenModeChanged(ScreenMode sm, boolean success) {
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivity.java b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivity.java
new file mode 100644
index 000000000..c627ce725
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivity.java
@@ -0,0 +1,77 @@
+/**
+ * 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 javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+
+import jogamp.newt.driver.android.NewtBaseActivity;
+
+import com.jogamp.graph.curve.Region;
+import com.jogamp.newt.ScreenMode;
+import com.jogamp.newt.event.ScreenModeListener;
+import com.jogamp.newt.opengl.GLWindow;
+
+import com.jogamp.opengl.test.junit.graph.demos.GPUUISceneGLListener0A;
+import com.jogamp.opengl.util.Animator;
+
+import android.os.Bundle;
+import android.util.Log;
+
+public class NEWTGraphUI2pActivity extends NewtBaseActivity {
+ static String TAG = "NEWTGraphUIActivity";
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ Log.d(TAG, "onCreate - 0");
+ super.onCreate(savedInstanceState);
+
+ // create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
+ GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
+ caps.setAlphaBits(4);
+ caps.setNumSamples(4);
+ caps.setSampleBuffers(true);
+ Log.d(TAG, "req caps: "+caps);
+ GLWindow glWindow = GLWindow.create(caps);
+ setContentView(glWindow);
+
+ glWindow.addGLEventListener(new GPUUISceneGLListener0A(Region.VBAA_RENDERING_BIT));
+ glWindow.getWindow().getScreen().addScreenModeListener(new ScreenModeListener() {
+ public void screenModeChangeNotify(ScreenMode sm) { }
+ public void screenModeChanged(ScreenMode sm, boolean success) {
+ System.err.println("ScreenMode Changed: "+sm);
+ }
+ });
+ glWindow.setVisible(true);
+ Animator animator = new Animator(glWindow);
+ animator.setUpdateFPSFrames(60, System.err);
+ setAnimator(animator);
+
+ Log.d(TAG, "onCreate - X");
+ }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java
index 63daff27c..540aade38 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java
@@ -8,6 +8,7 @@ import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLPipelineFactory;
import javax.media.opengl.GLRunnable;
+import com.jogamp.graph.curve.Region;
import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.curve.opengl.RenderState;
import com.jogamp.graph.font.Font;
@@ -27,6 +28,10 @@ public class GPUUISceneGLListener0A implements GLEventListener {
private boolean debug = false;
private boolean trace = false;
+ private final int renderModes;
+ private final int texSize;
+ private final int renderModes2;
+ private final int texSize2;
private RegionRenderer regionRenderer;
private RenderState rs;
@@ -60,16 +65,25 @@ public class GPUUISceneGLListener0A implements GLEventListener {
private float angText = 0;
public GPUUISceneGLListener0A() {
- this(RenderState.createRenderState(new ShaderState(), SVertex.factory()), false, false);
+ this(0);
}
- public GPUUISceneGLListener0A(RenderState rs, boolean debug, boolean trace) {
+ public GPUUISceneGLListener0A(int renderModes) {
+ this(RenderState.createRenderState(new ShaderState(), SVertex.factory()), renderModes, false, false);
+ }
+
+ public GPUUISceneGLListener0A(RenderState rs, int renderModes, boolean debug, boolean trace) {
this.rs = rs;
+ this.renderModes = renderModes;
+ this.texSize = Region.isVBAA(renderModes) ? 400 : 0;
+ this.renderModes2 = 0;
+ this.texSize2 = 0;
this.debug = debug;
this.trace = trace;
font = FontFactory.get(FontFactory.UBUNTU).getDefault();
labelRegions = new UIRegion[3];
+ sceneUIController = new SceneUIController();
}
private void initButtons(int width, int height) {
@@ -93,6 +107,10 @@ public class GPUUISceneGLListener0A implements GLEventListener {
buttons[1] = new RIButton(SVertex.factory(), font, "Show FPS", xSize, ySize){
public void onClick() {
+ final GLAnimatorControl a = cDrawable.getAnimator();
+ if( null != a ) {
+ a.resetFPSCounter();
+ }
showFPS = !showFPS;
}
public void onPressed() { }
@@ -106,9 +124,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
cDrawable.invoke(false, new GLRunnable() {
public boolean run(GLAutoDrawable drawable) {
GL gl = drawable.getGL();
- int i = gl.getSwapInterval();
- i = i==0 ? 1 : 0;
- gl.setSwapInterval(i);
+ gl.setSwapInterval(gl.getSwapInterval()<=0?1:0);
final GLAnimatorControl a = drawable.getAnimator();
if( null != a ) {
a.resetFPSCounter();
@@ -196,9 +212,8 @@ public class GPUUISceneGLListener0A implements GLEventListener {
}
this.font = FontFactory.get(fontSet).getDefault();
- regionRenderer = RegionRenderer.create(rs, 0);
+ regionRenderer = RegionRenderer.create(rs, renderModes);
- gl.setSwapInterval(1);
gl.glEnable(GL2ES2.GL_DEPTH_TEST);
gl.glEnable(GL2ES2.GL_BLEND);
@@ -209,14 +224,15 @@ public class GPUUISceneGLListener0A implements GLEventListener {
initTexts();
initButtons(width, height);
- sceneUIController.setRenderer(regionRenderer, rs);
+ sceneUIController.setRenderer(regionRenderer, rs, renderModes, texSize);
sceneUIController.addShape(buttons[0]);
sceneUIController.addShape(buttons[1]);
sceneUIController.addShape(buttons[2]);
sceneUIController.addShape(buttons[3]);
sceneUIController.addShape(buttons[4]);
sceneUIController.addShape(buttons[5]);
-
+ drawable.addGLEventListener(sceneUIController);
+
Label jlabel = new Label(SVertex.factory(), font, fontSizeFixed, jogamp){
public void onClick() { }
public void onPressed() { }
@@ -224,6 +240,10 @@ public class GPUUISceneGLListener0A implements GLEventListener {
};
jogampRegion = new UIRegion(jlabel);
+ final GLAnimatorControl a = drawable.getAnimator();
+ if( null != a ) {
+ a.resetFPSCounter();
+ }
}
public void dispose(GLAutoDrawable drawable) {
@@ -235,8 +255,10 @@ public class GPUUISceneGLListener0A implements GLEventListener {
System.err.println("GPUUISceneGLListener0A: dispose (0)");
}
+ drawable.removeGLEventListener(sceneUIController);
+ sceneUIController.dispose(drawable);
+
GL2ES2 gl = drawable.getGL().getGL2ES2();
- sceneUIController = null;
regionRenderer.destroy(gl);
}
@@ -287,7 +309,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
regionRenderer.rotate(gl, zoomText, 0, 1, 0);
regionRenderer.setColorStatic(gl, 0.0f, 0.0f, 0.0f);
- regionRenderer.draw(gl, labelRegions[currentText].getRegion(gl, rs, 0), new float[]{0,0,0}, 0);
+ regionRenderer.draw(gl, labelRegions[currentText].getRegion(gl, rs, renderModes2), new float[]{0,0,0}, texSize2);
final GLAnimatorControl animator = drawable.getAnimator();
final boolean _drawFPS = showFPS && null != animator;
@@ -326,8 +348,6 @@ public class GPUUISceneGLListener0A implements GLEventListener {
if ( null == multiTouchListener ) {
multiTouchListener = new MultiTouchListener();
window.addMouseListener(multiTouchListener);
- sceneUIController = new SceneUIController();
- window.addGLEventListener(sceneUIController);
sceneUIController.attachInputListenerTo(window);
}
}
@@ -335,7 +355,6 @@ public class GPUUISceneGLListener0A implements GLEventListener {
public void detachInputListenerFrom(GLWindow window) {
if ( null != multiTouchListener ) {
window.removeMouseListener(multiTouchListener);
- window.removeGLEventListener(sceneUIController);
sceneUIController.detachInputListenerFrom(window);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo01.java
index 14276ce44..91f66875b 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo01.java
@@ -29,12 +29,12 @@ public class GPUUISceneNewtDemo01 {
window.setTitle("GraphUI Newt Demo");
final RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
- GPUUISceneGLListener0A textGLListener = new GPUUISceneGLListener0A(rs, DEBUG, TRACE);
+ GPUUISceneGLListener0A textGLListener = new GPUUISceneGLListener0A(rs, 0, DEBUG, TRACE);
window.addGLEventListener(textGLListener);
textGLListener.attachInputListenerTo(window);
final Animator animator = new Animator();
- animator.setUpdateFPSFrames(10, null);
+ animator.setUpdateFPSFrames(60, System.err);
animator.add(window);
window.addWindowListener(new WindowAdapter() {
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo02.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo02.java
new file mode 100644
index 000000000..a6cd770d1
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo02.java
@@ -0,0 +1,50 @@
+package com.jogamp.opengl.test.junit.graph.demos;
+
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+
+import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.geom.opengl.SVertex;
+import com.jogamp.newt.event.WindowAdapter;
+import com.jogamp.newt.event.WindowEvent;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.glsl.ShaderState;
+
+public class GPUUISceneNewtDemo02 {
+ static final boolean DEBUG = false;
+ static final boolean TRACE = false;
+
+ public static void main(String[] args) {
+ GLProfile.initSingleton(true);
+ GLProfile glp = GLProfile.getGL2ES2();
+ GLCapabilities caps = new GLCapabilities(glp);
+ caps.setAlphaBits(4);
+ caps.setSampleBuffers(true);
+ caps.setNumSamples(4);
+
+ final GLWindow window = GLWindow.create(caps);
+ window.setPosition(10, 10);
+ window.setSize(680, 480);
+ window.setTitle("GraphUI Newt Demo");
+
+ final RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
+ GPUUISceneGLListener0A textGLListener = new GPUUISceneGLListener0A(rs, Region.VBAA_RENDERING_BIT, DEBUG, TRACE);
+ window.addGLEventListener(textGLListener);
+ textGLListener.attachInputListenerTo(window);
+
+ final Animator animator = new Animator();
+ animator.setUpdateFPSFrames(60, System.err);
+ animator.add(window);
+
+ window.addWindowListener(new WindowAdapter() {
+ public void windowDestroyed(WindowEvent e) {
+ animator.stop();
+ }
+ });
+
+ window.setVisible(true);
+ animator.start();
+ }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java
index 83fc08b86..ca70481d7 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java
@@ -100,7 +100,7 @@ public abstract class Label extends UIShape implements UITextShape {
@Override
public void render(GL2ES2 gl, RenderState rs, RegionRenderer renderer,
- boolean selection) {
+ int renderModes, int texSize, boolean selection) {
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RIButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RIButton.java
index 60f79e2d7..3acab3bdb 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RIButton.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RIButton.java
@@ -108,7 +108,6 @@ public abstract class RIButton extends UIShape {
float th = (2f*spacing) + lbox.getHeight();
float tw = (2f*spacing) + lbox.getWidth();
- float[] pos = getPosition();
float minX = lbox.getMinX()-spacing;
float minY = lbox.getMinY()-spacing;
float minZ = labelZOffset;
@@ -127,7 +126,6 @@ public abstract class RIButton extends UIShape {
float cw = 0.5f*corner*Math.min(tw, th);
float ch = 0.5f*corner*Math.min(tw, th);
- float[] pos = getPosition();
float minX = lbox.getMinX()-spacing;
float minY = lbox.getMinY()-spacing;
float minZ = labelZOffset;
@@ -201,8 +199,7 @@ public abstract class RIButton extends UIShape {
private boolean toggle =false;
private boolean toggleable = false;
-
- public void render(GL2ES2 gl, RenderState rs, RegionRenderer renderer, boolean selection) {
+ public void render(GL2ES2 gl, RenderState rs, RegionRenderer renderer, int renderModes, int texSize, boolean selection) {
if(null == buttonRegion) {
buttonRegion = new UIRegion(this);
labelRegion = new UIRegion(getLabel());
@@ -218,7 +215,7 @@ public abstract class RIButton extends UIShape {
if(!selection){
renderer.setColorStatic(gl, bColor[0], bColor[1], bColor[2]);
}
- renderer.draw(gl, buttonRegion.getRegion(gl, rs, 0), getPosition(), 0);
+ renderer.draw(gl, buttonRegion.getRegion(gl, rs, renderModes), getPosition(), texSize);
gl.glDisable(GL2ES2.GL_POLYGON_OFFSET_FILL);
float[] lColor = labelColor;
@@ -228,7 +225,7 @@ public abstract class RIButton extends UIShape {
if(!selection){
renderer.setColorStatic(gl, lColor[0], lColor[1], lColor[2]);
}
- renderer.draw(gl, labelRegion.getRegion(gl, rs, 0), getPosition(), 0);
+ renderer.draw(gl, labelRegion.getRegion(gl, rs, renderModes), getPosition(), texSize);
}
public void setPressed(boolean b) {
super.setPressed(b);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java
index deefbf783..6a400e95f 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java
@@ -22,6 +22,8 @@ public class SceneUIController implements GLEventListener{
private ArrayList<UIShape> shapes = new ArrayList<UIShape>();
private int count = 0;
+ private int renderModes;
+ private int texSize;
private RegionRenderer renderer = null;
private RenderState rs = null;
@@ -38,17 +40,20 @@ public class SceneUIController implements GLEventListener{
private GLAutoDrawable cDrawable = null;
public SceneUIController() {
-
}
- public void setRenderer(RegionRenderer renderer, RenderState rs) {
+ public void setRenderer(RegionRenderer renderer, RenderState rs, int renderModes, int texSize) {
this.renderer = renderer;
this.rs = rs;
+ this.renderModes = renderModes;
+ this.texSize = texSize;
}
- public SceneUIController(RegionRenderer renderer, RenderState rs) {
+ public SceneUIController(RegionRenderer renderer, RenderState rs, int renderModes, int texSize) {
this.renderer = renderer;
this.rs = rs;
+ this.renderModes = renderModes;
+ this.texSize = texSize;
}
public void attachInputListenerTo(GLWindow window) {
@@ -89,7 +94,7 @@ public class SceneUIController implements GLEventListener{
final int height = drawable.getHeight();
GL2ES2 gl = drawable.getGL().getGL2ES2();
- render(gl, width, height,false);
+ render(gl, width, height, renderModes, texSize, false);
}
public void dispose(GLAutoDrawable drawable) {
@@ -131,7 +136,7 @@ public class SceneUIController implements GLEventListener{
gl.glClearColor(sceneClearColor[0], sceneClearColor[1], sceneClearColor[2], sceneClearColor[3]);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
- render(gl, width, height,true);
+ render(gl, width, height, 0, 0, true);
ByteBuffer pixel = Buffers.newDirectByteBuffer(4);
pixel.order(ByteOrder.nativeOrder());
IntBuffer viewport = IntBuffer.allocate(4);
@@ -146,7 +151,7 @@ public class SceneUIController implements GLEventListener{
return index;
}
- private void render(GL2ES2 gl, int width, int height, boolean select) {
+ private void render(GL2ES2 gl, int width, int height, int renderModes, int texSize, boolean select) {
renderer.reshapePerspective(null, 45.0f, width, height, 0.1f, 7000.0f);
for(int index=0; index < count;index++){
@@ -163,7 +168,7 @@ public class SceneUIController implements GLEventListener{
renderer.rotate(gl, rotation[1], 0, 1, 0);
renderer.rotate(gl, rotation[2], 0, 0, 1);
- shapes.get(index).render(gl, rs, renderer,select);
+ shapes.get(index).render(gl, rs, renderer, renderModes, texSize, select);
renderer.rotate(gl, -rotation[0], 1, 0, 0);
renderer.rotate(gl, -rotation[1], 0, 1, 0);
renderer.rotate(gl, -rotation[2], 0, 0, 1);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java
index 6768eccca..5f92f13ec 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java
@@ -32,13 +32,8 @@ import javax.media.opengl.GL;
import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLAutoDrawable;
-import jogamp.graph.curve.text.GlyphString;
-
-import com.jogamp.graph.curve.OutlineShape;
-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.TextRenderer;
import com.jogamp.graph.font.Font;
import com.jogamp.graph.font.FontFactory;
import com.jogamp.graph.geom.opengl.SVertex;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java
index ebed0f7aa..c04fa8b60 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java
@@ -55,7 +55,7 @@ public abstract class UIShape {
shape.clear();
}
- public abstract void render(GL2ES2 gl, RenderState rs, RegionRenderer renderer, boolean selection);
+ public abstract void render(GL2ES2 gl, RenderState rs, RegionRenderer renderer, int renderModes, int texSize, boolean selection);
protected boolean positionDirty = false;