From efa5f1110725d41b7ea58010fe34b2a8aacd185b Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 9 Jul 2014 21:32:13 +0200 Subject: Bug 801: Add Graph pass-2 shader for VBAA 'odd' sample count --- .../opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java | 10 +++------- .../opengl/test/junit/graph/demos/ui/SceneUIController.java | 6 +++++- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/test/com') 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