summaryrefslogtreecommitdiffstats
path: root/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2009-04-26 23:20:59 +0000
committerKenneth Russel <[email protected]>2009-04-26 23:20:59 +0000
commitca57e7dd0d9f2502cbc606d177929d36d3501fe1 (patch)
treebcd66bb62f1423753afba299606bbe73662e606b /src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java
parentbcb1ba1a2af77732d4ee3fed25e696d19aa269da (diff)
Partially fixed breakage to ProceduralTexturePhysics demo; exposes
fundamental problems with the function name unification now going on by default -- and not configurable -- in GlueGen; must at least have the ARB_vertex_program and ARB_fragment_program extensions and entry points exposed separately from the unified versions in order to properly access them git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JOGL_2_SANDBOX@332 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java')
-rw-r--r--src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java44
1 files changed, 24 insertions, 20 deletions
diff --git a/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java b/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java
index f4dc264..427d645 100644
--- a/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java
+++ b/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java
@@ -76,40 +76,32 @@ import javax.swing.JOptionPane;
*/
public class ProceduralTexturePhysics extends Demo {
- public ProceduralTexturePhysics() {
-
+ public static void main(String[] args) {
GLCanvas canvas = new GLCanvas();
- ProceduralTexturePhysics demo = new ProceduralTexturePhysics();
+ final ProceduralTexturePhysics demo = new ProceduralTexturePhysics();
canvas.addGLEventListener(demo);
canvas.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
- dispatchKey(e.getKeyChar());
+ demo.dispatchKey(e.getKeyChar());
}
});
canvas.addMouseListener(new MouseAdapter() {
-
public void mousePressed(MouseEvent e) {
- if (e.getButton() == MouseEvent.BUTTON1 &&
- !e.isAltDown() && !e.isMetaDown()) {
- drawing = true;
- }
+ demo.dispatchMousePress(e);
}
public void mouseReleased(MouseEvent e) {
- if (e.getButton() == MouseEvent.BUTTON1) {
- drawing = false;
- }
+ demo.dispatchMouseRelease(e);
}
});
canvas.addMouseMotionListener(new MouseMotionAdapter() {
public void mouseDragged(MouseEvent e) {
- mousePosX = e.getX();
- mousePosY = e.getY();
+ demo.dispatchMouseDrag(e);
}
});
@@ -398,6 +390,24 @@ public class ProceduralTexturePhysics extends Demo {
}
}
+ private void dispatchMousePress(MouseEvent e) {
+ if (e.getButton() == MouseEvent.BUTTON1 &&
+ !e.isAltDown() && !e.isMetaDown()) {
+ drawing = true;
+ }
+ }
+
+ private void dispatchMouseRelease(MouseEvent e) {
+ if (e.getButton() == MouseEvent.BUTTON1) {
+ drawing = false;
+ }
+ }
+
+ public void dispatchMouseDrag(MouseEvent e) {
+ mousePosX = e.getX();
+ mousePosY = e.getY();
+ }
+
private static void runExit(final Animator animator) {
// Note: calling System.exit() synchronously inside the draw,
// reshape or init callbacks can lead to deadlocks on certain
@@ -412,10 +422,4 @@ public class ProceduralTexturePhysics extends Demo {
}
}).start();
}
-
-
-
- public static void main(String[] args) {
- new ProceduralTexturePhysics();
- }
}