aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-09 21:32:13 +0200
committerSven Gothel <[email protected]>2014-07-09 21:32:13 +0200
commitefa5f1110725d41b7ea58010fe34b2a8aacd185b (patch)
tree61e5817a13717579f0b8853c8dc3498bc182a7bd /src/test
parent4fd8983ecce4c95ff502604fbeb4ecabcf1f5c26 (diff)
Bug 801: Add Graph pass-2 shader for VBAA 'odd' sample count
Diffstat (limited to 'src/test')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java6
2 files changed, 8 insertions, 8 deletions
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 45ed14f7b..784fe1009 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
@@ -309,16 +309,12 @@ public class GPUUISceneGLListener0A implements GLEventListener {
int sampleCount = sceneUIController.getSampleCount();
if( shapeEvent.objPos[0] < shapeEvent.shape.getBounds().getCenter()[0] ) {
// left-half pressed
- if( sampleCount > 0 ) {
- sampleCount-=1;
- }
+ sampleCount--;
} else {
// right-half pressed
- if( sampleCount < 8 ) {
- sampleCount+=1;
- }
+ sampleCount++;
}
- sceneUIController.setSampleCount(sampleCount);
+ sampleCount = sceneUIController.setSampleCount(sampleCount); // validated / clipped
}
} } );
button.addMouseListener(dragZoomRotateListener);
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 008d4e038..3d4865b5d 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
@@ -99,7 +99,11 @@ public class SceneUIController implements GLEventListener{
}
public int getSampleCount() { return sampleCount[0]; }
- public void setSampleCount(final int v) { sampleCount[0]=v; markAllShapesDirty(); }
+ public int setSampleCount(final int v) {
+ sampleCount[0] = Math.min(8, Math.max(v, 1)); // clip
+ markAllShapesDirty();
+ return sampleCount[0];
+ }
public void setAllShapesQuality(final int q) {
for(int i=0; i<shapes.size(); i++) {