summaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-09-03 15:28:41 +0200
committerSven Gothel <[email protected]>2013-09-03 15:28:41 +0200
commite3a5868b189b4979a8a85746b1ae3b880ed8f8f0 (patch)
treead76b2c4fdf6f3e0dc8845a91fa136f22ca9f8e0 /src/test/com/jogamp/opengl
parentf4ba3b4c780e96bda3d082dc793ed278de2f1c00 (diff)
Gears: Make rotation optional
Diffstat (limited to 'src/test/com/jogamp/opengl')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Gears.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Gears.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Gears.java
index 020c5c63f..d3ab05e82 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Gears.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Gears.java
@@ -29,6 +29,7 @@ public class Gears implements GLEventListener {
private float view_rotx = 20.0f, view_roty = 30.0f, view_rotz = 0.0f;
private int gear1=0, gear2=0, gear3=0;
private float angle = 0.0f;
+ private boolean doRotate = true;
private int swapInterval;
private MouseListener gearsMouse = new GearsMouseAdapter();
private KeyListener gearsKeys = new GearsKeyAdapter();
@@ -44,6 +45,8 @@ public class Gears implements GLEventListener {
this.swapInterval = 1;
}
+ public void setDoRotation(boolean rotate) { this.doRotate = rotate; }
+
public void setGears(int g1, int g2, int g3) {
gear1 = g1;
gear2 = g2;
@@ -167,8 +170,10 @@ public class Gears implements GLEventListener {
}
public void display(GLAutoDrawable drawable) {
- // Turn the gears' teeth
- angle += 2.0f;
+ if( doRotate ) {
+ // Turn the gears' teeth
+ angle += 2.0f;
+ }
// Get the GL corresponding to the drawable we are animating
GL2 gl = drawable.getGL().getGL2();