aboutsummaryrefslogtreecommitdiffstats
path: root/src/junit
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-04-27 07:18:54 +0200
committerSven Gothel <[email protected]>2010-04-27 07:18:54 +0200
commitd370be30dc75cc3b63246f026090a7377bf07135 (patch)
tree1de511925eefc2f7237d0551fae1e3e417f55805 /src/junit
parentedaf669e1b8c8412c1fd4acfc799138b629bf031 (diff)
- Fix GLProcAddressResolver regression: Use GLProcAddressResolver !
- X11GLXDrawableFactory: - Move shared resource creation/destruction into it's own thread - Remove the ATI hack (no XDisplay closing) for every Display, this is only necessary for the shared XDisplay and in case of AWT. - Newt - Display: Only pumpMessages if device is ready. - X11Display: Verify handle not null at DispatchMessage. - Common recursive ToolkitLock implementation, from src/nativewindow/classes/com/jogamp/nativewindow/impl/LockingNativeWindowFactory.java and src/newt/classes/com/jogamp/newt/Window.java, -> com.jogamp.nativewindow.impl.RecursiveToolkitLock - Unique XLockDisplay/XUnlockDisplay call via X11Util to simplify debugging. X11Util: Added debug code for XLockDisplay/XUnlockDisplay. Added fast LongObjectHashMap Added static lib loading and initialization. Removed active and passive list, as well as unused methods, to easy maintenance. Possible since the only 'uncloseable' Display might be the shareable one. - X11Lib: Added static initialization via X11Util Test: junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGears* - Add WindowListener for quit ..
Diffstat (limited to 'src/junit')
-rw-r--r--src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/Gears.java1
-rw-r--r--src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/QuitAdapter.java (renamed from src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/QuitKeyAdapter.java)11
-rwxr-xr-xsrc/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java10
-rwxr-xr-xsrc/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsNEWT.java8
-rwxr-xr-xsrc/junit/com/jogamp/test/junit/jogl/texture/TestTexture01AWT.java2
5 files changed, 21 insertions, 11 deletions
diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/Gears.java b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/Gears.java
index 956f4f1e3..a5bf3fda7 100644
--- a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/Gears.java
+++ b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/Gears.java
@@ -65,6 +65,7 @@ public class Gears implements GLEventListener {
gl.glEnable(GL2.GL_NORMALIZE);
MouseListener gearsMouse = new TraceMouseAdapter(new GearsMouseAdapter());
+ // MouseListener gearsMouse = new GearsMouseAdapter();
if (drawable instanceof Component) {
Component comp = (Component) drawable;
diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/QuitKeyAdapter.java b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/QuitAdapter.java
index 443fd74b1..8581bc9f8 100644
--- a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/QuitKeyAdapter.java
+++ b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/QuitAdapter.java
@@ -36,16 +36,23 @@ package com.jogamp.test.junit.jogl.demos.gl2.gears;
import com.jogamp.opengl.util.Animator;
import com.jogamp.newt.event.*;
-class QuitKeyAdapter extends KeyAdapter {
+class QuitAdapter extends WindowAdapter implements WindowListener, KeyListener {
boolean shouldQuit = false;
public boolean shouldQuit() { return shouldQuit; }
+ public void windowDestroyNotify(WindowEvent e) {
+ System.out.println("QUIT Window "+Thread.currentThread());
+ shouldQuit = true;
+ }
+
public void keyTyped(KeyEvent e) {
if(e.getKeyChar()=='q') {
- System.out.println("QUIT "+Thread.currentThread());
+ System.out.println("QUIT Key "+Thread.currentThread());
shouldQuit = true;
}
}
+ public void keyPressed(KeyEvent e) {}
+ public void keyReleased(KeyEvent e) {}
}
diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java
index dc0923ee8..21487c519 100755
--- a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java
+++ b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java
@@ -36,7 +36,9 @@ import javax.media.opengl.*;
import com.jogamp.opengl.util.Animator;
import javax.media.opengl.awt.GLCanvas;
import com.jogamp.newt.event.awt.AWTKeyAdapter;
+import com.jogamp.newt.event.awt.AWTWindowAdapter;
import com.jogamp.newt.event.TraceKeyAdapter;
+import com.jogamp.newt.event.TraceWindowAdapter;
import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
import java.awt.Frame;
@@ -76,15 +78,15 @@ public class TestGearsAWT {
glCanvas.addGLEventListener(new Gears());
Animator animator = new Animator(glCanvas);
- QuitKeyAdapter quitKeyAdapter = new QuitKeyAdapter();
+ QuitAdapter quitAdapter = new QuitAdapter();
- new AWTKeyAdapter(new TraceKeyAdapter()).addTo(glCanvas);
- new AWTKeyAdapter(quitKeyAdapter).addTo(glCanvas);
+ new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(glCanvas);
+ new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
frame.setVisible(true);
animator.start();
- while(!quitKeyAdapter.shouldQuit() && animator.isAnimating() && animator.getDuration()<duration) {
+ while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getDuration()<duration) {
Thread.sleep(100);
}
diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsNEWT.java b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsNEWT.java
index 835d19185..23c39290c 100755
--- a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsNEWT.java
+++ b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsNEWT.java
@@ -71,16 +71,16 @@ public class TestGearsNEWT {
glWindow.addGLEventListener(new Gears());
Animator animator = new Animator(glWindow);
- QuitKeyAdapter quitKeyAdapter = new QuitKeyAdapter();
+ QuitAdapter quitAdapter = new QuitAdapter();
- glWindow.addKeyListener(new TraceKeyAdapter());
- glWindow.addKeyListener(quitKeyAdapter);
+ glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
+ glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
glWindow.setSize(width, height);
glWindow.setVisible(true);
animator.start();
- while(!quitKeyAdapter.shouldQuit() && animator.isAnimating() && animator.getDuration()<duration) {
+ while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getDuration()<duration) {
Thread.sleep(100);
}
diff --git a/src/junit/com/jogamp/test/junit/jogl/texture/TestTexture01AWT.java b/src/junit/com/jogamp/test/junit/jogl/texture/TestTexture01AWT.java
index 4bbbaa271..dbd685760 100755
--- a/src/junit/com/jogamp/test/junit/jogl/texture/TestTexture01AWT.java
+++ b/src/junit/com/jogamp/test/junit/jogl/texture/TestTexture01AWT.java
@@ -97,10 +97,10 @@ public class TestTexture01AWT {
animator.stop();
frame.setVisible(false);
-
frame.remove(glCanvas);
frame.dispose();
frame=null;
+ glCanvas=null;
}
public static void main(String args[]) {