hello, i have a question about the animator.stop
function:
how can i reach a clean quit in jogl application
public void keyReleased(KeyEvent key) {
switch (key.getKeyCode()) {
case KeyEvent.VK_ESCAPE:
system.exit(0);
break;
this exit didnt call the windowclosing and i have no idea
how to do it!
(after 3-5 time i run my application,the pc slows completly down,i think the exit didnt work good)
what can i do?
public static void main(String[] args) {
…
final FPSAnimator animator = new FPSAnimator(canvas,60 );
animator.setRunAsFastAsPossible(true);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing() {
runExit(animator);
}
});
…
…
private static void runExit(final FPSAnimator animator) {
new Thread(new Runnable() {
public void run() {
animator.stop();
System.exit(0);
}
}).start();
}