aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-04-26 07:47:19 +0200
committerSven Gothel <[email protected]>2011-04-26 07:47:19 +0200
commitf47230cb4649df13260ac56c5dae6c01dad7c1e7 (patch)
tree72ca609de469e98118b65130aba4ab90be48625d /src/newt/classes/com
parent6e499630c878ff74c81c1c6c84542230a48e2c5d (diff)
Newt Window: Remove 'invalidate()' method, only 'destroy()' is required (and makes sense)
- WindowImpl/GLWindow: Cleanup destroy code .. - Tests: sync / remove FPS stderr print
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r--src/newt/classes/com/jogamp/newt/Window.java9
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java43
2 files changed, 16 insertions, 36 deletions
diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java
index b78f7a9e8..5b3d93eec 100644
--- a/src/newt/classes/com/jogamp/newt/Window.java
+++ b/src/newt/classes/com/jogamp/newt/Window.java
@@ -109,19 +109,12 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
* which will issue {@link Screen#destroy()} if the reference count becomes 0.<br>
* This destruction sequence shall end up in {@link Display#destroy()}, if all reference counts become 0.
* </p>
- * @see #invalidate()
+ * @see #destroy()
* @see #setVisible(boolean)
*/
void destroy();
/**
- * Destroys the Window via {@link #destroy()} and clears all Object references,
- * eg. all states, size, position, parent handles, list of child Windows and reference to it's Screen.<br>
- * This Window cannot be recreated after calling this method anymore.<br>
- */
- void invalidate();
-
- /**
* <p>
* <code>setVisible</code> makes the window and children visible if <code>visible</code> is true,
* otherwise the window and children becomes invisible.<br></p>
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index bc0d67bfc..d8eda923a 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -341,28 +341,18 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC
}
context = null;
drawable = null;
-
+
+ GLAnimatorControl ctrl = GLWindow.this.getAnimator();
+ if ( null!=ctrl ) {
+ ctrl.remove(GLWindow.this);
+ }
+ // helper=null; // pending events ..
+
if(Window.DEBUG_WINDOW_EVENT || Window.DEBUG_IMPLEMENTATION) {
System.err.println("GLWindow.destroy() "+Thread.currentThread()+", fin");
}
}
- public synchronized void invalidate(boolean unrecoverable) {
- if(Window.DEBUG_WINDOW_EVENT || Window.DEBUG_IMPLEMENTATION) {
- String msg = "GLWindow.invalidate("+unrecoverable+") "+Thread.currentThread()+", start";
- System.err.println(msg);
- //Exception e1 = new Exception(msg);
- //e1.printStackTrace();
- }
- if(unrecoverable) {
- GLAnimatorControl ctrl = GLWindow.this.getAnimator();
- if ( null!=ctrl ) {
- ctrl.remove(GLWindow.this);
- }
- helper=null;
- }
- }
-
public synchronized void resetCounter() {
if(Window.DEBUG_WINDOW_EVENT || Window.DEBUG_IMPLEMENTATION) {
System.err.println("GLWindow.resetCounter() "+Thread.currentThread());
@@ -407,19 +397,20 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC
}
}
+ private GLAnimatorControl savedAnimator = null;
+
public synchronized boolean pauseRenderingAction() {
boolean animatorPaused = false;
- GLAnimatorControl ctrl = GLWindow.this.getAnimator();
- if ( null!=ctrl ) {
- animatorPaused = ctrl.pause();
+ savedAnimator = GLWindow.this.getAnimator();
+ if ( null != savedAnimator ) {
+ animatorPaused = savedAnimator.pause();
}
return animatorPaused;
}
public synchronized void resumeRenderingAction() {
- GLAnimatorControl ctrl = GLWindow.this.getAnimator();
- if ( null!=ctrl && ctrl.isPaused() ) {
- ctrl.resume();
+ if ( null != savedAnimator && savedAnimator.isPaused() ) {
+ savedAnimator.resume();
}
}
}
@@ -849,10 +840,6 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC
return window.surfaceSwap();
}
- public final void invalidate() {
- window.invalidate();
- }
-
public final long getWindowHandle() {
return window.getWindowHandle();
@@ -917,7 +904,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC
});
glWindow.setVisible(true);
- glWindow.invalidate();
+ glWindow.destroy();
}
}