diff options
-rw-r--r-- | java-dbg.sh | 2 | ||||
-rwxr-xr-x | java-macosx-mainthread.sh | 2 | ||||
-rwxr-xr-x | java-macosx.sh | 2 | ||||
-rwxr-xr-x | src/demos/es1/RedSquare.java | 3 | ||||
-rwxr-xr-x | src/demos/es2/RedSquare.java | 16 |
5 files changed, 21 insertions, 4 deletions
diff --git a/java-dbg.sh b/java-dbg.sh index 4298a82..fd88bcd 100644 --- a/java-dbg.sh +++ b/java-dbg.sh @@ -1,7 +1,7 @@ #! /bin/sh # java -Dgluegen.debug.ProcAddressHelper=true -Dgluegen.debug.NativeLibrary=true -Dnativewindow.debug=all -Djogl.debug=all $* 2>&1 | tee java-dbg.log -java -Dnewt.debug.Window -Dnativewindow.debug=all -Djogl.debug=all $* 2>&1 | tee java-dbg.log +java -Dnewt.debug=all -Dnativewindow.debug=all -Djogl.debug=all $* 2>&1 | tee java-dbg.log # java -Djogl.debug=all $* 2>&1 | tee java-dbg.log diff --git a/java-macosx-mainthread.sh b/java-macosx-mainthread.sh index 37d1fb4..d8536fa 100755 --- a/java-macosx-mainthread.sh +++ b/java-macosx-mainthread.sh @@ -1,3 +1,3 @@ #! /bin/sh -java -XstartOnFirstThread com.sun.javafx.newt.util.MainThread $* +java -XstartOnFirstThread -Djava.awt.headless=true com.sun.javafx.newt.util.MainThread $* 2>&1 | tee java-macosx.mainThread.log diff --git a/java-macosx.sh b/java-macosx.sh index d2e2125..ee793df 100755 --- a/java-macosx.sh +++ b/java-macosx.sh @@ -1,3 +1,3 @@ #! /bin/sh -java -XstartOnFirstThread -Djava.awt.headless=true $* +java -XstartOnFirstThread -Djava.awt.headless=true $* 2>&1 | tee java-macosx.log diff --git a/src/demos/es1/RedSquare.java b/src/demos/es1/RedSquare.java index 4227418..58b5e01 100755 --- a/src/demos/es1/RedSquare.java +++ b/src/demos/es1/RedSquare.java @@ -41,6 +41,9 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo public void keyPressed(KeyEvent e) { System.out.println(glp+" "+e); + if(e.getKeyCode()==KeyEvent.VK_Q) { + quit = true; + } } public void keyReleased(KeyEvent e) { System.out.println(glp+" "+e); diff --git a/src/demos/es2/RedSquare.java b/src/demos/es2/RedSquare.java index d2149bc..d1d2c5d 100755 --- a/src/demos/es2/RedSquare.java +++ b/src/demos/es2/RedSquare.java @@ -12,7 +12,7 @@ import com.sun.opengl.util.glsl.*; import com.sun.javafx.newt.*; import com.sun.javafx.newt.opengl.*; -public class RedSquare extends Thread implements WindowListener, MouseListener, GLEventListener { +public class RedSquare extends Thread implements WindowListener, KeyListener, MouseListener, GLEventListener { private GLWindow window; private GLProfile glp; @@ -41,6 +41,19 @@ public class RedSquare extends Thread implements WindowListener, MouseListener, quit = true; } + public void keyPressed(KeyEvent e) { + System.out.println(glp+" "+e); + if(e.getKeyCode()==KeyEvent.VK_Q) { + quit = true; + } + } + public void keyReleased(KeyEvent e) { + System.out.println(glp+" "+e); + } + public void keyTyped(KeyEvent e) { + System.out.println(glp+" "+e); + } + public void mouseClicked(MouseEvent e) { System.out.println(glp+" mouseevent: "+e); switch(e.getClickCount()) { @@ -85,6 +98,7 @@ public class RedSquare extends Thread implements WindowListener, MouseListener, window.addWindowListener(this); window.addMouseListener(this); + window.addKeyListener(this); window.addGLEventListener(this); // window.setEventHandlerMode(GLWindow.EVENT_HANDLER_GL_CURRENT); // default // window.setEventHandlerMode(GLWindow.EVENT_HANDLER_GL_NONE); // no current .. |