summaryrefslogtreecommitdiffstats
path: root/src/demos/applets
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-10-12 02:11:15 -0700
committerSven Gothel <[email protected]>2009-10-12 02:11:15 -0700
commit93a269bccf608baa5e7f8b7ec13ba823b8b2f086 (patch)
treece7506646e3100b94a8380528ca42da1ec0c3350 /src/demos/applets
parentd1a53b3ba93789aea1c37d042bc722a2a9c052d9 (diff)
JOGLNewtAppletBase et al - no dispose event at destruction, since it's critical within a browser
Diffstat (limited to 'src/demos/applets')
-rwxr-xr-xsrc/demos/applets/JOGLNewtApplet1Run.java12
-rwxr-xr-xsrc/demos/applets/JOGLNewtAppletBase.java5
2 files changed, 12 insertions, 5 deletions
diff --git a/src/demos/applets/JOGLNewtApplet1Run.java b/src/demos/applets/JOGLNewtApplet1Run.java
index f839387..e3696ab 100755
--- a/src/demos/applets/JOGLNewtApplet1Run.java
+++ b/src/demos/applets/JOGLNewtApplet1Run.java
@@ -16,6 +16,7 @@ import com.sun.javafx.newt.opengl.*;
public class JOGLNewtApplet1Run extends Applet {
JOGLNewtAppletBase base;
+ Window nWindow = null;
public void init() {
if(!(this instanceof Container)) {
@@ -51,8 +52,8 @@ public class JOGLNewtApplet1Run extends Applet {
GLCapabilities caps = new GLCapabilities(GLProfile.get(glProfileName));
Display nDisplay = NewtFactory.createDisplay(NativeWindowFactory.TYPE_AWT, null); // local display
Screen nScreen = NewtFactory.createScreen(NativeWindowFactory.TYPE_AWT, nDisplay, 0); // screen 0
- Window nWindow = NewtFactory.createWindow(NativeWindowFactory.TYPE_AWT, new Object[] { container },
- nScreen, caps, true /* undecorated */);
+ nWindow = NewtFactory.createWindow(NativeWindowFactory.TYPE_AWT, new Object[] { container },
+ nScreen, caps, true /* undecorated */);
// nWindow.setPosition(x, y);
// nWindow.setSize(container.getWidth(), container.getHeight());
if(null!=nWindow) {
@@ -85,7 +86,12 @@ public class JOGLNewtApplet1Run extends Applet {
}
public void destroy() {
- base.destroy();
+ base.destroy(false); // no dispose events
+ base=null;
+ if(null!=nWindow) {
+ nWindow.destroy();
+ nWindow=null;
+ }
}
}
diff --git a/src/demos/applets/JOGLNewtAppletBase.java b/src/demos/applets/JOGLNewtAppletBase.java
index 12d2af7..428e0b2 100755
--- a/src/demos/applets/JOGLNewtAppletBase.java
+++ b/src/demos/applets/JOGLNewtAppletBase.java
@@ -151,7 +151,8 @@ public class JOGLNewtAppletBase implements WindowListener, KeyListener, MouseLis
}
}
- public void destroy() {
+ /** @param sendDisposeEvent should be false in a [time,reliable] critical shutdown */
+ public void destroy(boolean sendDisposeEvent) {
isValid = false;
if(null!=glAnimator) {
glAnimator.stop();
@@ -159,7 +160,7 @@ public class JOGLNewtAppletBase implements WindowListener, KeyListener, MouseLis
glAnimator=null;
}
if(null!=glWindow) {
- glWindow.destroy(true); // deep, incl. Screen and Display
+ glWindow.destroy(sendDisposeEvent);
glWindow=null;
}
}